-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Search#image_facets and Search#video_facets methods
Note: Change default endpoint to https://api.twitter.com/i/
- Loading branch information
Showing
9 changed files
with
2,271 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module Twitter | ||
class Client | ||
# Defines methods related to Search | ||
module Search | ||
# Returns recent images related to a query | ||
# | ||
# @note Undocumented | ||
# @rate_limited Yes | ||
# @requires_authentication No | ||
# @response_format `json` | ||
# @response_format `xml` | ||
# @param q [String] A search term. | ||
# @param options [Hash] A customizable set of options. | ||
# @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. | ||
# @option options [Boolean, String, Integer] :include_entities Include {http://dev.twitter.com/pages/tweet_entities Tweet Entities} when set to true, 't' or 1. | ||
# @return [Array] An array of statuses that contain images | ||
# @example Return recent images related to twitter | ||
# Twitter.image_facets('twitter') | ||
def image_facets(q, options={}) | ||
response = get('search/image_facets', options.merge(:q => q)) | ||
format.to_s.downcase == 'xml' ? response['statuses'] : response | ||
end | ||
|
||
# Returns recent videos related to a query | ||
# | ||
# @note Undocumented | ||
# @rate_limited Yes | ||
# @requires_authentication No | ||
# @response_format `json` | ||
# @response_format `xml` | ||
# @param q [String] A search term. | ||
# @param options [Hash] A customizable set of options. | ||
# @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100. | ||
# @option options [Boolean, String, Integer] :include_entities Include {http://dev.twitter.com/pages/tweet_entities Tweet Entities} when set to true, 't' or 1. | ||
# @return [Array] An array of statuses that contain videos | ||
# @example Return recent videos related to twitter | ||
# Twitter.video_facets('twitter') | ||
def video_facets(q, options={}) | ||
response = get('search/video_facets', options.merge(:q => q)) | ||
format.to_s.downcase == 'xml' ? response['statuses'] : response | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.