java.lang.Object edu.ubc.cpsc.googlex.SimpleGoogleSearch
public class SimpleGoogleSearch
A simple class to search Google using JSON and the Google AJAX Search API.
Constructor Summary | |
---|---|
SimpleGoogleSearch()
Default Constructor |
Method Summary | |
---|---|
boolean |
doSearch(java.lang.String queryString)
Search for the given query, that is, a string you might type into Google when performing a search. |
int |
getHitCount()
Get the number of hits the latest search produced. |
int |
getNumResults()
Gets the number of search results (i.e., snippets) from the latest search. |
java.lang.String |
getSnippetAt(int index)
The snippet Google returned for the search result with the given index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleGoogleSearch()
Method Detail |
---|
public boolean doSearch(java.lang.String queryString)
queryString
- a query (non-null)
public int getHitCount()
public int getNumResults()
public java.lang.String getSnippetAt(int index)
index
- a number between 0 and getNumResults - 1. NOTE THAT THIS
STARTS AT ZERO!