Module: Twitter::Client::Search
- Included in:
- Twitter::Client
- Defined in:
- lib/twitter/client/search.rb
Overview
Defines methods related to Search
Instance Method Summary collapse
-
#images(q, options = {}) ⇒ Array<Twitter::Status>
Returns recent statuses that contain images related to a query.
-
#phoenix_search(q, options = {}) ⇒ Array<Twitter::Status>
Returns recent statuses related to a query with images and videos embedded.
-
#search(q, options = {}) ⇒ Array<Twitter::Status>
Returns tweets that match a specified query.
-
#videos(q, options = {}) ⇒ Array<Twitter::Status>
Returns recent statuses that contain videos related to a query.
Instance Method Details
#images(q, options = {}) ⇒ Array<Twitter::Status>
Undocumented
Returns recent statuses that contain images related to a query
20 21 22 23 24 |
# File 'lib/twitter/client/search.rb', line 20 def images(q, ={}) get("/i/search/image_facets.json", .merge(:q => q), :phoenix => true).map do |status| Twitter::Status.new(status) end end |
#phoenix_search(q, options = {}) ⇒ Array<Twitter::Status>
Undocumented
Returns recent statuses related to a query with images and videos embedded
86 87 88 89 90 |
# File 'lib/twitter/client/search.rb', line 86 def phoenix_search(q, ={}) get("/phoenix_search.phoenix", .merge(:q => q), :phoenix => true)['statuses'].map do |status| Twitter::Status.new(status) end end |
#search(q, options = {}) ⇒ Array<Twitter::Status>
As of April 1st 2010, the Search API provides an option to retrieve "popular tweets" in addition to real-time search results. In an upcoming release, this will become the default and clients that don't want to receive popular tweets in their search results will have to explicitly opt-out. See the result_type parameter below for more information.
Returns tweets that match a specified query.
67 68 69 70 71 |
# File 'lib/twitter/client/search.rb', line 67 def search(q, ={}) get("/search.json", .merge(:q => q), :endpoint => search_endpoint)['results'].map do |status| Twitter::Status.new(status) end end |
#videos(q, options = {}) ⇒ Array<Twitter::Status>
Undocumented
Returns recent statuses that contain videos related to a query
38 39 40 41 42 |
# File 'lib/twitter/client/search.rb', line 38 def videos(q, ={}) get("/i/search/video_facets.json", .merge(:q => q), :phoenix => true).map do |status| Twitter::Status.new(status) end end |