Sha256: 1bffe27583d8a133ac402aaf135c12fcef9dc230340f3705f0ca8f950c616717

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

module GoogleAjax
  class Search < Results
    # A shortcut to the estimated result count
    # e.g. GoogleAjax.books("Iliad").count  # => 60000
    def count
      self[:cursor][:estimated_result_count]
    end

    ##
    # :call-seq:
    #   local(query, args = {})
    # Arguments: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_local
    def self.local(query, latitude, longitude, args = {})
      args = { :sll => "#{latitude},#{longitude}" }.merge(args)
      get(:local, query, args)
    end

    ##
    # :call-seq:
    #   blogs(query, args = {})
    # Arguments: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_blog
  
    ##
    # :call-seq:
    #   books(query, args = {})
    # Arguments: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_book

    ##
    # :call-seq:
    #   images(query, args = {})
    # Arguments: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_image

    ##
    # :call-seq:
    #   news(query, args = {})
    # Arguments: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_news

    ##
    # :call-seq:
    #   video(query, args = {})
    # Arguments: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_video

    ##
    # :call-seq:
    #   web(query, args = {})
    # http://code.google.com/apis/ajaxsearch/documentation/reference.html#_fonje_web

    standard_api :blogs, :books, :images, :news, :video, :web
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
googleajax-1.0.0 lib/googleajax/search.rb