Class: XTwitterScraper::Resources::X::Lists
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::X::Lists
- Defined in:
- lib/x_twitter_scraper/resources/x/lists.rb,
sig/x_twitter_scraper/resources/x/lists.rbs
Overview
X List followers, members, and tweets
Instance Method Summary collapse
-
#initialize(client:) ⇒ Lists
constructor
private
A new instance of Lists.
-
#retrieve_followers(id, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers
Some parameter documentations has been truncated, see Models::X::ListRetrieveFollowersParams for more details.
-
#retrieve_members(id, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers
Some parameter documentations has been truncated, see Models::X::ListRetrieveMembersParams for more details.
-
#retrieve_tweets(id, cursor: nil, include_replies: nil, page_size: nil, since_time: nil, until_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets
Some parameter documentations has been truncated, see Models::X::ListRetrieveTweetsParams for more details.
Constructor Details
#initialize(client:) ⇒ Lists
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 Lists.
204 205 206 |
# File 'lib/x_twitter_scraper/resources/x/lists.rb', line 204 def initialize(client:) @client = client end |
Instance Method Details
#retrieve_followers(id, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers
Some parameter documentations has been truncated, see Models::X::ListRetrieveFollowersParams for more details.
List followers of an X List
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/x_twitter_scraper/resources/x/lists.rb', line 58 def retrieve_followers(id, params = {}) parsed, = XTwitterScraper::X::ListRetrieveFollowersParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["x/lists/%1$s/followers", id], query: query.transform_keys( bio_contains: "bioContains", has_location: "hasLocation", has_website: "hasWebsite", location_contains: "locationContains", max_followers: "maxFollowers", max_following: "maxFollowing", max_statuses: "maxStatuses", min_account_age_days: "minAccountAgeDays", min_followers: "minFollowers", min_following: "minFollowing", min_statuses: "minStatuses", page_size: "pageSize", username_contains: "usernameContains", verified_only: "verifiedOnly", verified_type: "verifiedType" ), model: XTwitterScraper::PaginatedUsers, options: ) end |
#retrieve_members(id, bio_contains: nil, cursor: nil, has_location: nil, has_website: nil, location_contains: nil, max_followers: nil, max_following: nil, max_statuses: nil, min_account_age_days: nil, min_followers: nil, min_following: nil, min_statuses: nil, page_size: nil, username_contains: nil, verified_only: nil, verified_type: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedUsers
Some parameter documentations has been truncated, see Models::X::ListRetrieveMembersParams for more details.
List members of an X List
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/x_twitter_scraper/resources/x/lists.rb', line 132 def retrieve_members(id, params = {}) parsed, = XTwitterScraper::X::ListRetrieveMembersParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["x/lists/%1$s/members", id], query: query.transform_keys( bio_contains: "bioContains", has_location: "hasLocation", has_website: "hasWebsite", location_contains: "locationContains", max_followers: "maxFollowers", max_following: "maxFollowing", max_statuses: "maxStatuses", min_account_age_days: "minAccountAgeDays", min_followers: "minFollowers", min_following: "minFollowing", min_statuses: "minStatuses", page_size: "pageSize", username_contains: "usernameContains", verified_only: "verifiedOnly", verified_type: "verifiedType" ), model: XTwitterScraper::PaginatedUsers, options: ) end |
#retrieve_tweets(id, cursor: nil, include_replies: nil, page_size: nil, since_time: nil, until_time: nil, request_options: {}) ⇒ XTwitterScraper::Models::PaginatedTweets
Some parameter documentations has been truncated, see Models::X::ListRetrieveTweetsParams for more details.
List tweets from an X List
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/x_twitter_scraper/resources/x/lists.rb', line 184 def retrieve_tweets(id, params = {}) parsed, = XTwitterScraper::X::ListRetrieveTweetsParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["x/lists/%1$s/tweets", id], query: query.transform_keys( include_replies: "includeReplies", page_size: "pageSize", since_time: "sinceTime", until_time: "untilTime" ), model: XTwitterScraper::PaginatedTweets, options: ) end |