Class: Google::Ajax::Feed::API::OneZero
- Inherits:
-
Object
- Object
- Google::Ajax::Feed::API::OneZero
- Defined in:
- lib/google_ajax_feed_api/api/one_zero.rb
Class Method Summary collapse
-
.find ⇒ Object
The endpoint URI for search requests.
-
.find_query(query) ⇒ Object
Builds a query to search for feeds query is a search term.
-
.load ⇒ Object
The endpoint URI for loading feeds.
-
.load_params(options = {}) ⇒ Object
:nodoc.
-
.load_query(url, options = {}) ⇒ Object
Builds a query options are overrides for Feed#config options.
-
.lookup ⇒ Object
The endpoint URI for lookup requests.
-
.lookup_query(url) ⇒ Object
Builds a query to lookup a feed for a url.
-
.params(query) ⇒ Object
:nodoc:.
Class Method Details
.find ⇒ Object
The endpoint URI for search requests
13 14 15 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 13 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
29 30 31 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 29 def find_query query "#{find}#{params query}" end |
.load ⇒ Object
The endpoint URI for loading feeds
18 19 20 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 18 def load "http://ajax.googleapis.com/ajax/services/feed/load" end |
.load_params(options = {}) ⇒ Object
:nodoc
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 39 def load_params ={} #:nodoc = ({ :limit => Feed.config.limit, :history => Feed.config.history }).merge() params = "&num=#{[:limit]}" params << '&scoring=h' if [:history] params end |
.load_query(url, options = {}) ⇒ Object
Builds a query options are overrides for Feed#config options
35 36 37 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 35 def load_query url, ={} "#{load}#{params url}#{load_params }" end |
.lookup ⇒ Object
The endpoint URI for lookup requests
8 9 10 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 8 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
23 24 25 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 23 def lookup_query url "#{lookup}#{params url}" end |
.params(query) ⇒ Object
:nodoc:
50 51 52 |
# File 'lib/google_ajax_feed_api/api/one_zero.rb', line 50 def params query #:nodoc: "?v=1.0&q=#{URI.encode query}" end |