Class: Google::Ajax::Feed::API::OneZero

Inherits:
Object
  • Object
show all
Defined in:
lib/google_ajax_feed_api.rb

Class Method Summary collapse

Class Method Details

.findObject

The endpoint URI for search requests



67
68
69
# File 'lib/google_ajax_feed_api.rb', line 67

def find
  "http://ajax.googleapis.com/ajax/services/feed/find"
end

.find_query(query) ⇒ Object

Builds a query to search for feeds query is a search term



84
85
86
# File 'lib/google_ajax_feed_api.rb', line 84

def find_query query
  "#{find}#{params query}"
end

.loadObject

The endpoint URI for loading feeds



72
73
74
# File 'lib/google_ajax_feed_api.rb', line 72

def load 
  "http://ajax.googleapis.com/ajax/services/feed/load"
end

.load_params(options = {}) ⇒ Object

:nodoc



95
96
97
98
99
100
101
102
103
104
# File 'lib/google_ajax_feed_api.rb', line 95

def load_params options={} #:nodoc
  options = ({
    :limit => Feed.config.limit,
    :history => Feed.config.history
  }).merge(options)
  
  params = "&num=#{options[:limit]}"
  params << '&scoring=h' if options[:history]
  params        
end

.load_query(url, options = {}) ⇒ Object

Builds a query options are overrides for Feed#config options



91
92
93
# File 'lib/google_ajax_feed_api.rb', line 91

def load_query url, options={}
  "#{load}#{params url}#{load_params options}"
end

.lookupObject

The endpoint URI for lookup requests



62
63
64
# File 'lib/google_ajax_feed_api.rb', line 62

def lookup
  "http://ajax.googleapis.com/ajax/services/feed/lookup"
end

.lookup_query(url) ⇒ Object

Builds a query to lookup a feed for a url



77
78
79
# File 'lib/google_ajax_feed_api.rb', line 77

def lookup_query url
  "#{lookup}#{params url}"
end

.params(query) ⇒ Object

:nodoc:



106
107
108
# File 'lib/google_ajax_feed_api.rb', line 106

def params query #:nodoc:
  "?v=1.0&q=#{URI.encode query}"
end