Module: Twitter::REST::PremiumSearch
- Included in:
- API
- Defined in:
- lib/twitter/rest/premium_search.rb
Constant Summary collapse
- MAX_TWEETS_PER_REQUEST =
100
Instance Method Summary collapse
-
#premium_search(query, options = {}, request_config = {}) ⇒ Twitter::PremiumSearchResults
Returns tweets from the 30-Day API that match a specified query.
Instance Method Details
#premium_search(query, options = {}, request_config = {}) ⇒ Twitter::PremiumSearchResults
Returns tweets from the 30-Day API that match a specified query.
23 24 25 26 27 28 29 30 31 |
# File 'lib/twitter/rest/premium_search.rb', line 23 def premium_search(query, = {}, request_config = {}) = .clone [:maxResults] ||= MAX_TWEETS_PER_REQUEST request_config[:request_method] = :json_post if request_config[:request_method].nil? || request_config[:request_method] == :post request_config[:product] ||= "30day" path = "/1.1/tweets/search/#{request_config[:product]}/#{dev_environment}.json" request = Twitter::REST::Request.new(self, request_config[:request_method], path, .merge(query:)) Twitter::PremiumSearchResults.new(request, request_config) end |