Method: Overlord::GoogleSearchRequest.local_search
- Defined in:
- lib/overlord/google_search_request.rb
.local_search(query, options = {}) ⇒ Object
Run a local search Google docs: code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_local For example: rsz This optional argument supplies the number of results that the application would like to recieve. A value of small
indicates a small result set size or 4 results. A value of large indicates a large result set or 8 results.
If this argument is not supplied, a value of small is assumed.
start This optional argument supplies the start index of the first search result. Each successful response contains
a cursor object (see below) which includes an array of pages. The start property for a page may be used as a
valid value for this argument.
Pass any of the standard search options:
http://code.google.com/apis/ajaxsearch/documentation/reference.html#_intro_fonje
Pass any of the following options: sll This optional argument supplies the search center point for a local search. It’s value is a comma separated latitude/longitude pair, e.g., sll=48.8565,2.3509. sspn This optional argument supplies a bounding box that the local search should be relative to. When using a Google Map, the sspn value can be computed using: myMap.getBounds().toSpan().toUrlValue(); (e.g., sspn=0.065169,0.194149). mrt This optional argument specifies which type of listing the user is interested in. Valid values include:
* blended - request KML, Local Business Listings, and Geocode results
* kmlonly - request KML and Geocode results
* localonly - request Local Business Listings and Geocode results
If this argument is not supplied, the default value of localonly is used.
33 34 35 |
# File 'lib/overlord/google_search_request.rb', line 33 def self.local_search(query, = {}) get('http://ajax.googleapis.com/ajax/services/search/local', :query => build_google_query(.merge(:q => query))) end |