Download Google Web API for ColdFusion (CFX_GOOGLE)
CFX_Google
SUMMARY
CFX_GOOGLE is a Java CFX tag that uses the Google Search Web API to perform a query on the Google search engine and return a result set. The CFX tag encapsulates the SOAP requests and responses providing the developer with a ColdFusion Query containing the search results.
To use the tag you must obtain a google search key from google.com/apis
This tag is FREE and OPEN SOURCE.
TAG ATTRIBUTES
| ATTRIBUTE |
REQUIRED |
TYPE |
DESCRIPTION |
| KEY |
yes |
string |
Google Search key code you need to generate one at google.com/apis |
| RESULTS |
yes |
variable |
Name of the results query that the tag will return. See "RESULTS QUERY" below. |
| QUERY |
yes |
string |
Your google search query (what you are searching for) |
| START |
no |
number |
The result number the search results query will start at |
| MAXROWS |
no |
number |
The maximum number of results to return per query, 1-10 default is 10 |
RESULTS QUERY
| COLUMN |
DESCRIPTION |
| TITLE |
The page title of the result. |
| SNIPPET |
A snippet of the result page, the description. |
| URL |
The URL of the result page. |
| DIRECTORYCATEGORY |
The name of the Open Directory Category that the result occurrs in. |
| DIRECTORYTITLE |
The name of the result as it appears in the Open Directory |
| SUMMARY |
Description of the result as it appears in the Open Directory. |
| CACHEDSIZE |
The size of the cached document. |
| RELATEDPRESENT |
True if there are related documents to this result |
| HOSTNAME |
The hostname of the result, used for "More Results From: hostname" searches. |
QUERY META DATA - additional information about the search
| VARIABLE |
DESCRIPTION |
| GOOGLE.SEARCHTIME |
The time it took the google server to compute the results |
| GOOGLE.SPELLCHECK |
The query with a corrected spelling suggestion. |
| GOOGLE.SEARCHTIPS |
Tips for searching |
| GOOGLE.TOTALRESULTS |
An estimate of the total number of results for your query |
| GOOGLE.ESTIMATEISEXACT |
Wether the total results estimate is exact. |
| GOOGLE.SEARCHCOMMENTS |
Search Comments |
EXAMPLE - see included google.cfm
INSTALL
If you are running Windows NT/2000 on ColdFusion 4.5.x or 5.0 you should run Setup.exe
If you are running any Other Platform please follow the instructions below...
- Read And agree to License.txt
- Copy the docs, and google.cfm to a directory under your web server root
- Download a JVM, If you have not done so already goto http://java.sun.com/products/ and download the Java 2 Standard Edition JRE (Java Runtime Environment), install it.
- Log into your ColdFusion Administrator, click on "Java" from the menu on the left.
- If there is not already a value (There shouldn't be unless you already installed it) Enter the path to your Java Virtual Machine "JVM". The default on windows is c:\program files\JavaSoft\JRE\1.3\bin\hotspot\jvm.dll or /usr/java/jdk1.3/hotspot/libjvm.so
If you cannot find the locations try: Start -> Find -> jvm.dll (Windows) $> find / | grep libjvm.so (UNIX)
- In the classpath setting (Still in the Java Settings of CF Administrator) add the full path to googleapi.jar (eg c:\cfdev\CFX_Google\googleapi.jar)
seperate with a semi-colin (;) for windows, and with a colin (:) for UNIX.
- Click "Apply"
- Click on "CFX Tags" from the left menu. Enter in CFX_Google in the text box, and select "Java" for tag type, click add.
- Under Class Name put: CFX_Google and enter a description, the supplied description is "Google API Client from CFDEV.COM"
- Click "Apply"
- Restart ColdFusion.
|