Class: XTwitterScraper::Resources::Trends
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::Trends
- Defined in:
- lib/x_twitter_scraper/resources/trends.rb
Overview
Trending topics by region
Instance Method Summary collapse
-
#initialize(client:) ⇒ Trends
constructor
private
A new instance of Trends.
-
#list(count: nil, woeid: nil, request_options: {}) ⇒ XTwitterScraper::Models::TrendListResponse
Get regional trending topics.
Constructor Details
#initialize(client:) ⇒ Trends
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Trends.
35 36 37 |
# File 'lib/x_twitter_scraper/resources/trends.rb', line 35 def initialize(client:) @client = client end |
Instance Method Details
#list(count: nil, woeid: nil, request_options: {}) ⇒ XTwitterScraper::Models::TrendListResponse
Get regional trending topics
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/x_twitter_scraper/resources/trends.rb', line 20 def list(params = {}) parsed, = XTwitterScraper::TrendListParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "trends", query: query, model: XTwitterScraper::Models::TrendListResponse, options: ) end |