Google.cfc v0.3
Why
It took me a few hours to make the Google API work with Cold Fusion. The results of the search API are a complex java object, so there seemed a need for translating this to something more coldfusion native.
Usage
<cfinvoke component="lab.cf.google.google" method="search" returnvariable="googleResults" >
<cfinvokeargument name="q" value="uzilla"/>
<cfinvokeargument name="start" value=1/>
<cfinvokeargument name="maxResults" value="10" <cfinvokeargument
name="key" value="...">
</cfinvoke>
The search method returns an array of structures with the following
keys:
| CACHEDSIZE |
| HOSTNAME |
| SNIPPET |
| SUMMARY |
| TITLE |
| URL |
Change Notes
- v0.3: Added ability to query for more than just 10 records. Note, for every 10 retrieved, you will use one of your 1000 daily allotted queries.
Source
google_cfc.zip
License
google.cfc is licensed under the Mozilla Public License. If you improve it,
you are obligated to share your enhancements.
Future Work
Additional development might support more methods of the google api, optionally
return a query instead of a struct. What else? Built-in caching?
Feedback to andyed(at)surfmind.com.
|
Sample Query: Top Twenty Results for "cold fusion blog" (with filter on)
|
|