From b7fafe0efcf6b27464565ca4c54159c2276cb58a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 10:59:36 +0000 Subject: [PATCH 1/2] feat(api): sync public contracts --- .stats.yml | 6 +- lib/x_twitter_scraper/models/error.rb | 12 + .../models/x/tweet_get_quotes_params.rb | 4 +- .../models/x/tweet_get_replies_params.rb | 4 +- .../models/x/tweet_get_thread_params.rb | 310 +++++++++- .../models/x/tweet_search_params.rb | 4 +- .../models/x/user_retrieve_likes_params.rb | 4 +- .../models/x/user_retrieve_media_params.rb | 4 +- .../models/x/user_retrieve_mentions_params.rb | 4 +- .../models/x/user_retrieve_replies_params.rb | 4 +- .../models/x/user_retrieve_tweets_params.rb | 4 +- lib/x_twitter_scraper/resources/x/tweets.rb | 104 +++- lib/x_twitter_scraper/resources/x/users.rb | 10 +- rbi/x_twitter_scraper/models/error.rbi | 60 ++ .../models/x/tweet_get_quotes_params.rbi | 4 +- .../models/x/tweet_get_replies_params.rbi | 4 +- .../models/x/tweet_get_thread_params.rbi | 566 ++++++++++++++++++ .../models/x/tweet_search_params.rbi | 4 +- .../models/x/user_retrieve_likes_params.rbi | 4 +- .../models/x/user_retrieve_media_params.rbi | 4 +- .../x/user_retrieve_mentions_params.rbi | 4 +- .../models/x/user_retrieve_replies_params.rbi | 4 +- .../models/x/user_retrieve_tweets_params.rbi | 4 +- rbi/x_twitter_scraper/resources/x/tweets.rbi | 110 +++- rbi/x_twitter_scraper/resources/x/users.rbi | 10 +- sig/x_twitter_scraper/models/error.rbs | 24 + .../models/x/tweet_get_thread_params.rbs | 289 ++++++++- sig/x_twitter_scraper/resources/x/tweets.rbs | 32 + 28 files changed, 1540 insertions(+), 57 deletions(-) diff --git a/.stats.yml b/.stats.yml index 61f7c4d..a89002f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 124 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-d5ea5609c8180c1340dd312fcb526d52953040de479617d4755673705d7c1334.yml -openapi_spec_hash: 9b5ddbbd9ca6b21d24051d6b7cec9123 -config_hash: 217d68ca6999ad03cfc4922e9658297e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-878138bbf57021047ac2af87a490a147b1d41367ee7807cc188d3247cc4b255d.yml +openapi_spec_hash: 1f50b417a17776f9f361f34552879e64 +config_hash: a4624963c7e5bdbdf085e64f3101d3b0 diff --git a/lib/x_twitter_scraper/models/error.rb b/lib/x_twitter_scraper/models/error.rb index 32a2054..dc143f0 100644 --- a/lib/x_twitter_scraper/models/error.rb +++ b/lib/x_twitter_scraper/models/error.rb @@ -118,12 +118,17 @@ module LegacyErrorCode IDEMPOTENCY_CONFLICT = :idempotency_conflict IDEMPOTENCY_KEY_CONFLICT = :idempotency_key_conflict INVALID_COMMUNITY_ID = :invalid_community_id + INVALID_COMPLETE_REPLIES_REQUEST = :invalid_complete_replies_request INVALID_COVERAGE_CURSOR = :invalid_coverage_cursor + INVALID_COVERAGE_REQUEST = :invalid_coverage_request INVALID_IDEMPOTENCY_KEY = :invalid_idempotency_key INVALID_LIST_ID = :invalid_list_id + INVALID_OUTPUT_OPTIONS = :invalid_output_options INVALID_PAYMENT_AMOUNT = :invalid_payment_amount INVALID_RANGE = :invalid_range + INVALID_REPLY_OPTIONS = :invalid_reply_options LOGIN_RATE_LIMITED = :login_rate_limited + LOGIN_SERVICE_UNAVAILABLE = :login_service_unavailable MISSING_IDEMPOTENCY_KEY = :missing_idempotency_key MISSING_IDS = :missing_ids NO_CACHED_STYLE = :no_cached_style @@ -134,6 +139,7 @@ module LegacyErrorCode SUPPORT_MEDIA_RATE_LIMIT = :support_media_rate_limit SUPPORT_REQUEST_RATE_LIMIT = :support_request_rate_limit TOO_MANY_IDS = :too_many_ids + TOO_MANY_TWEETS = :too_many_tweets UNKNOWN_FIELD = :unknown_field UNSUPPORTED_MEDIA_TYPE = :unsupported_media_type WEBHOOK_INACTIVE = :webhook_inactive @@ -251,12 +257,17 @@ module Code IDEMPOTENCY_CONFLICT = :idempotency_conflict IDEMPOTENCY_KEY_CONFLICT = :idempotency_key_conflict INVALID_COMMUNITY_ID = :invalid_community_id + INVALID_COMPLETE_REPLIES_REQUEST = :invalid_complete_replies_request INVALID_COVERAGE_CURSOR = :invalid_coverage_cursor + INVALID_COVERAGE_REQUEST = :invalid_coverage_request INVALID_IDEMPOTENCY_KEY = :invalid_idempotency_key INVALID_LIST_ID = :invalid_list_id + INVALID_OUTPUT_OPTIONS = :invalid_output_options INVALID_PAYMENT_AMOUNT = :invalid_payment_amount INVALID_RANGE = :invalid_range + INVALID_REPLY_OPTIONS = :invalid_reply_options LOGIN_RATE_LIMITED = :login_rate_limited + LOGIN_SERVICE_UNAVAILABLE = :login_service_unavailable MISSING_IDEMPOTENCY_KEY = :missing_idempotency_key MISSING_IDS = :missing_ids NO_CACHED_STYLE = :no_cached_style @@ -267,6 +278,7 @@ module Code SUPPORT_MEDIA_RATE_LIMIT = :support_media_rate_limit SUPPORT_REQUEST_RATE_LIMIT = :support_request_rate_limit TOO_MANY_IDS = :too_many_ids + TOO_MANY_TWEETS = :too_many_tweets UNKNOWN_FIELD = :unknown_field UNSUPPORTED_MEDIA_TYPE = :unsupported_media_type WEBHOOK_INACTIVE = :webhook_inactive diff --git a/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb index f770c01..94ba392 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb @@ -157,7 +157,7 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -366,7 +366,7 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb index a10e1e7..6fc5ddd 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb @@ -184,7 +184,7 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -421,7 +421,7 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb b/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb index 22b9ab9..18c395e 100644 --- a/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb @@ -17,12 +17,145 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :id, String + # @!attribute any_words + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + # + # @return [String, nil] + optional :any_words, String + + # @!attribute blue_verified_only + # Only return tweets from Blue-verified authors. + # + # @return [Boolean, nil] + optional :blue_verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!attribute cashtags + # Cashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :cashtags, String + + # @!attribute conversation_id + # Conversation ID filter. + # + # @return [String, nil] + optional :conversation_id, String + # @!attribute cursor # Pagination cursor for thread tweets # # @return [String, nil] optional :cursor, String + # @!attribute exact_phrase + # Exact phrase to match. + # + # @return [String, nil] + optional :exact_phrase, String + + # @!attribute exclude_words + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @return [String, nil] + optional :exclude_words, String + + # @!attribute from_user + # Filter by author username. + # + # @return [String, nil] + optional :from_user, String + + # @!attribute hashtags + # Hashtags separated by spaces, commas, or lines. + # + # @return [String, nil] + optional :hashtags, String + + # @!attribute in_reply_to_tweet_id + # Only replies to this tweet ID. + # + # @return [String, nil] + optional :in_reply_to_tweet_id, String + + # @!attribute language + # Language code filter, e.g. en or tr. + # + # @return [String, nil] + optional :language, String + + # @!attribute max_faves + # Maximum likes threshold. maxLikes is also accepted. + # + # @return [Integer, nil] + optional :max_faves, Integer + + # @!attribute max_quotes + # Maximum quotes threshold. + # + # @return [Integer, nil] + optional :max_quotes, Integer + + # @!attribute max_replies + # Maximum replies threshold. + # + # @return [Integer, nil] + optional :max_replies, Integer + + # @!attribute max_retweets + # Maximum retweets threshold. + # + # @return [Integer, nil] + optional :max_retweets, Integer + + # @!attribute media_type + # Filter by media type. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::MediaType, nil] + optional :media_type, enum: -> { XTwitterScraper::X::TweetGetThreadParams::MediaType } + + # @!attribute mentioning + # Filter tweets mentioning a username. + # + # @return [String, nil] + optional :mentioning, String + + # @!attribute min_bookmarks + # Minimum bookmark count threshold. + # + # @return [Integer, nil] + optional :min_bookmarks, Integer + + # @!attribute min_faves + # Minimum likes threshold. minLikes is also accepted. + # + # @return [Integer, nil] + optional :min_faves, Integer + + # @!attribute min_quotes + # Minimum quote count threshold. + # + # @return [Integer, nil] + optional :min_quotes, Integer + + # @!attribute min_replies + # Minimum replies threshold. + # + # @return [Integer, nil] + optional :min_replies, Integer + + # @!attribute min_retweets + # Minimum retweets threshold. + # + # @return [Integer, nil] + optional :min_retweets, Integer + + # @!attribute min_views + # Minimum view count threshold. + # + # @return [Integer, nil] + optional :min_views, Integer + # @!attribute page_size # Maximum page items (1-100, default 20). Source, filters, or credits can reduce # results. Continue while has_next_page is true. Deprecated limit and count @@ -31,17 +164,192 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :page_size, Integer - # @!method initialize(id:, cursor: nil, page_size: nil, request_options: {}) + # @!attribute quotes + # Quote mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Quotes, nil] + optional :quotes, enum: -> { XTwitterScraper::X::TweetGetThreadParams::Quotes } + + # @!attribute quotes_of_tweet_id + # Only quotes of this tweet ID. + # + # @return [String, nil] + optional :quotes_of_tweet_id, String + + # @!attribute replies + # Reply mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Replies, nil] + optional :replies, enum: -> { XTwitterScraper::X::TweetGetThreadParams::Replies } + + # @!attribute retweets + # Retweet mode. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Retweets, nil] + optional :retweets, enum: -> { XTwitterScraper::X::TweetGetThreadParams::Retweets } + + # @!attribute retweets_of_tweet_id + # Only retweets of this tweet ID. + # + # @return [String, nil] + optional :retweets_of_tweet_id, String + + # @!attribute since_date + # Start date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :since_date, Date + + # @!attribute to_user + # Filter replies sent to a username. + # + # @return [String, nil] + optional :to_user, String + + # @!attribute until_date + # End date in YYYY-MM-DD format. + # + # @return [Date, nil] + optional :until_date, Date + + # @!attribute url + # URL substring or domain filter. + # + # @return [String, nil] + optional :url, String + + # @!attribute verified_only + # Only return tweets from verified authors. + # + # @return [Boolean, nil] + optional :verified_only, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(id:, any_words: nil, blue_verified_only: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetGetThreadParams} for more details. # # @param id [String] # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param blue_verified_only [Boolean] Only return tweets from Blue-verified authors. + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for thread tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param max_faves [Integer] Maximum likes threshold. maxLikes is also accepted. + # + # @param max_quotes [Integer] Maximum quotes threshold. + # + # @param max_replies [Integer] Maximum replies threshold. + # + # @param max_retweets [Integer] Maximum retweets threshold. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_bookmarks [Integer] Minimum bookmark count threshold. + # + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param min_views [Integer] Minimum view count threshold. + # # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES = :images + VIDEOS = :videos + GIFS = :gifs + MEDIA = :media + LINKS = :links + NONE = :none + + # @!method self.values + # @return [Array] + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE = :include + EXCLUDE = :exclude + ONLY = :only + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/x/tweet_search_params.rb b/lib/x_twitter_scraper/models/x/tweet_search_params.rb index 0bfd336..97de807 100644 --- a/lib/x_twitter_scraper/models/x/tweet_search_params.rb +++ b/lib/x_twitter_scraper/models/x/tweet_search_params.rb @@ -179,7 +179,7 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -417,7 +417,7 @@ class TweetSearchParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb index 3279a30..453fdbd 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb @@ -151,7 +151,7 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -346,7 +346,7 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb index 5352b56..80457f7 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb @@ -151,7 +151,7 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -346,7 +346,7 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb index 1e7b69d..66a33b2 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb @@ -151,7 +151,7 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -358,7 +358,7 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb index 43baca1..67a61da 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb @@ -158,7 +158,7 @@ class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -354,7 +354,7 @@ class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb b/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb index c830c40..0a3f9e4 100644 --- a/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +++ b/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb @@ -164,7 +164,7 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel optional :min_bookmarks, Integer # @!attribute min_faves - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. # # @return [Integer, nil] optional :min_faves, Integer @@ -362,7 +362,7 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/resources/x/tweets.rb b/lib/x_twitter_scraper/resources/x/tweets.rb index 9c59d90..39ba271 100644 --- a/lib/x_twitter_scraper/resources/x/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/tweets.rb @@ -260,7 +260,7 @@ def get_favoriters(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # @@ -429,7 +429,7 @@ def get_quotes(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # @@ -621,14 +621,78 @@ def get_retweeters(id, params = {}) # # Get full conversation thread for a tweet # - # @overload get_thread(id, cursor: nil, page_size: nil, request_options: {}) + # @overload get_thread(id, any_words: nil, blue_verified_only: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_words: nil, from_user: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, max_faves: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, to_user: nil, until_date: nil, url: nil, verified_only: nil, request_options: {}) # # @param id [String] Tweet ID to get thread context # + # @param any_words [String] Words or quoted phrases where any one can match. Separate with spaces, commas, o + # + # @param blue_verified_only [Boolean] Only return tweets from Blue-verified authors. + # + # @param cashtags [String] Cashtags separated by spaces, commas, or lines. + # + # @param conversation_id [String] Conversation ID filter. + # # @param cursor [String] Pagination cursor for thread tweets # + # @param exact_phrase [String] Exact phrase to match. + # + # @param exclude_words [String] Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + # + # @param from_user [String] Filter by author username. + # + # @param hashtags [String] Hashtags separated by spaces, commas, or lines. + # + # @param in_reply_to_tweet_id [String] Only replies to this tweet ID. + # + # @param language [String] Language code filter, e.g. en or tr. + # + # @param max_faves [Integer] Maximum likes threshold. maxLikes is also accepted. + # + # @param max_quotes [Integer] Maximum quotes threshold. + # + # @param max_replies [Integer] Maximum replies threshold. + # + # @param max_retweets [Integer] Maximum retweets threshold. + # + # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::MediaType] Filter by media type. + # + # @param mentioning [String] Filter tweets mentioning a username. + # + # @param min_bookmarks [Integer] Minimum bookmark count threshold. + # + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. + # + # @param min_quotes [Integer] Minimum quote count threshold. + # + # @param min_replies [Integer] Minimum replies threshold. + # + # @param min_retweets [Integer] Minimum retweets threshold. + # + # @param min_views [Integer] Minimum view count threshold. + # # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # + # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Quotes] Quote mode. + # + # @param quotes_of_tweet_id [String] Only quotes of this tweet ID. + # + # @param replies [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Replies] Reply mode. + # + # @param retweets [Symbol, XTwitterScraper::Models::X::TweetGetThreadParams::Retweets] Retweet mode. + # + # @param retweets_of_tweet_id [String] Only retweets of this tweet ID. + # + # @param since_date [Date] Start date in YYYY-MM-DD format. + # + # @param to_user [String] Filter replies sent to a username. + # + # @param until_date [Date] End date in YYYY-MM-DD format. + # + # @param url [String] URL substring or domain filter. + # + # @param verified_only [Boolean] Only return tweets from verified authors. + # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # # @return [XTwitterScraper::Models::PaginatedTweets] @@ -640,7 +704,33 @@ def get_thread(id, params = {}) @client.request( method: :get, path: ["x/tweets/%1$s/thread", id], - query: query.transform_keys(page_size: "pageSize"), + query: query.transform_keys( + any_words: "anyWords", + blue_verified_only: "blueVerifiedOnly", + conversation_id: "conversationId", + exact_phrase: "exactPhrase", + exclude_words: "excludeWords", + from_user: "fromUser", + in_reply_to_tweet_id: "inReplyToTweetId", + max_faves: "maxFaves", + max_quotes: "maxQuotes", + max_replies: "maxReplies", + max_retweets: "maxRetweets", + media_type: "mediaType", + min_bookmarks: "minBookmarks", + min_faves: "minFaves", + min_quotes: "minQuotes", + min_replies: "minReplies", + min_retweets: "minRetweets", + min_views: "minViews", + page_size: "pageSize", + quotes_of_tweet_id: "quotesOfTweetId", + retweets_of_tweet_id: "retweetsOfTweetId", + since_date: "sinceDate", + to_user: "toUser", + until_date: "untilDate", + verified_only: "verifiedOnly" + ), model: XTwitterScraper::PaginatedTweets, options: options ) @@ -649,7 +739,9 @@ def get_thread(id, params = {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetSearchParams} for more details. # - # No-mode search maximizes coverage. + # No-mode search maximizes coverage. New cursorless `Latest` sessions return rows + # newest-first across cursor pages. Existing cursors preserve their established + # ordering. # # @overload search(q:, advanced_query: nil, any_words: nil, blue_verified_only: nil, bounding_box: nil, card_name: nil, cashtags: nil, conversation_id: nil, cursor: nil, exact_phrase: nil, exclude_source: nil, exclude_words: nil, from_user: nil, geocode: nil, hashtags: nil, in_reply_to_tweet_id: nil, language: nil, limit: nil, list_id: nil, max_faves: nil, max_id: nil, max_quotes: nil, max_replies: nil, max_retweets: nil, media_type: nil, mentioning: nil, min_bookmarks: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, min_views: nil, mode: nil, native_retweets: nil, near: nil, news: nil, place: nil, place_country: nil, point_radius: nil, query_type: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, safe: nil, since_date: nil, since_id: nil, since_time: nil, source: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, within: nil, within_time: nil, request_options: {}) # @@ -707,7 +799,7 @@ def get_thread(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/lib/x_twitter_scraper/resources/x/users.rb b/lib/x_twitter_scraper/resources/x/users.rb index 37507e3..00a6fd6 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -377,7 +377,7 @@ def retrieve_following(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # @@ -527,7 +527,7 @@ def retrieve_likes(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # @@ -677,7 +677,7 @@ def retrieve_media(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # @@ -837,7 +837,7 @@ def retrieve_mentions(id, params = {}) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # @@ -1064,7 +1064,7 @@ def retrieve_search(params) # # @param min_bookmarks [Integer] Minimum bookmark count threshold. # - # @param min_faves [Integer] Minimum likes threshold. + # @param min_faves [Integer] Minimum likes threshold. minLikes is also accepted. # # @param min_quotes [Integer] Minimum quote count threshold. # diff --git a/rbi/x_twitter_scraper/models/error.rbi b/rbi/x_twitter_scraper/models/error.rbi index eea7220..80813e5 100644 --- a/rbi/x_twitter_scraper/models/error.rbi +++ b/rbi/x_twitter_scraper/models/error.rbi @@ -397,11 +397,21 @@ module XTwitterScraper :invalid_community_id, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + INVALID_COMPLETE_REPLIES_REQUEST = + T.let( + :invalid_complete_replies_request, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) INVALID_COVERAGE_CURSOR = T.let( :invalid_coverage_cursor, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + INVALID_COVERAGE_REQUEST = + T.let( + :invalid_coverage_request, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) INVALID_IDEMPOTENCY_KEY = T.let( :invalid_idempotency_key, @@ -412,6 +422,11 @@ module XTwitterScraper :invalid_list_id, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + INVALID_OUTPUT_OPTIONS = + T.let( + :invalid_output_options, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) INVALID_PAYMENT_AMOUNT = T.let( :invalid_payment_amount, @@ -422,11 +437,21 @@ module XTwitterScraper :invalid_range, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + INVALID_REPLY_OPTIONS = + T.let( + :invalid_reply_options, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) LOGIN_RATE_LIMITED = T.let( :login_rate_limited, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + LOGIN_SERVICE_UNAVAILABLE = + T.let( + :login_service_unavailable, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) MISSING_IDEMPOTENCY_KEY = T.let( :missing_idempotency_key, @@ -477,6 +502,11 @@ module XTwitterScraper :too_many_ids, XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol ) + TOO_MANY_TWEETS = + T.let( + :too_many_tweets, + XTwitterScraper::Error::Error::LegacyErrorCode::TaggedSymbol + ) UNKNOWN_FIELD = T.let( :unknown_field, @@ -988,11 +1018,21 @@ module XTwitterScraper :invalid_community_id, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + INVALID_COMPLETE_REPLIES_REQUEST = + T.let( + :invalid_complete_replies_request, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) INVALID_COVERAGE_CURSOR = T.let( :invalid_coverage_cursor, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + INVALID_COVERAGE_REQUEST = + T.let( + :invalid_coverage_request, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) INVALID_IDEMPOTENCY_KEY = T.let( :invalid_idempotency_key, @@ -1003,6 +1043,11 @@ module XTwitterScraper :invalid_list_id, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + INVALID_OUTPUT_OPTIONS = + T.let( + :invalid_output_options, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) INVALID_PAYMENT_AMOUNT = T.let( :invalid_payment_amount, @@ -1013,11 +1058,21 @@ module XTwitterScraper :invalid_range, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + INVALID_REPLY_OPTIONS = + T.let( + :invalid_reply_options, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) LOGIN_RATE_LIMITED = T.let( :login_rate_limited, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + LOGIN_SERVICE_UNAVAILABLE = + T.let( + :login_service_unavailable, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) MISSING_IDEMPOTENCY_KEY = T.let( :missing_idempotency_key, @@ -1068,6 +1123,11 @@ module XTwitterScraper :too_many_ids, XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol ) + TOO_MANY_TWEETS = + T.let( + :too_many_tweets, + XTwitterScraper::Error::Error::StructuredError::Code::TaggedSymbol + ) UNKNOWN_FIELD = T.let( :unknown_field, diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi index 5b82ed9..e0d0e42 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi @@ -195,7 +195,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -517,7 +517,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi index 442b03e..ff1414f 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi @@ -226,7 +226,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -616,7 +616,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi index b999a7b..8bf5119 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi @@ -22,6 +22,35 @@ module XTwitterScraper sig { returns(String) } attr_accessor :id + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + sig { returns(T.nilable(String)) } + attr_reader :any_words + + sig { params(any_words: String).void } + attr_writer :any_words + + # Only return tweets from Blue-verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :blue_verified_only + + sig { params(blue_verified_only: T::Boolean).void } + attr_writer :blue_verified_only + + # Cashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :cashtags + + sig { params(cashtags: String).void } + attr_writer :cashtags + + # Conversation ID filter. + sig { returns(T.nilable(String)) } + attr_reader :conversation_id + + sig { params(conversation_id: String).void } + attr_writer :conversation_id + # Pagination cursor for thread tweets sig { returns(T.nilable(String)) } attr_reader :cursor @@ -29,6 +58,143 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor + # Exact phrase to match. + sig { returns(T.nilable(String)) } + attr_reader :exact_phrase + + sig { params(exact_phrase: String).void } + attr_writer :exact_phrase + + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :exclude_words + + sig { params(exclude_words: String).void } + attr_writer :exclude_words + + # Filter by author username. + sig { returns(T.nilable(String)) } + attr_reader :from_user + + sig { params(from_user: String).void } + attr_writer :from_user + + # Hashtags separated by spaces, commas, or lines. + sig { returns(T.nilable(String)) } + attr_reader :hashtags + + sig { params(hashtags: String).void } + attr_writer :hashtags + + # Only replies to this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :in_reply_to_tweet_id + + sig { params(in_reply_to_tweet_id: String).void } + attr_writer :in_reply_to_tweet_id + + # Language code filter, e.g. en or tr. + sig { returns(T.nilable(String)) } + attr_reader :language + + sig { params(language: String).void } + attr_writer :language + + # Maximum likes threshold. maxLikes is also accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :max_faves + + sig { params(max_faves: Integer).void } + attr_writer :max_faves + + # Maximum quotes threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :max_quotes + + sig { params(max_quotes: Integer).void } + attr_writer :max_quotes + + # Maximum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :max_replies + + sig { params(max_replies: Integer).void } + attr_writer :max_replies + + # Maximum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :max_retweets + + sig { params(max_retweets: Integer).void } + attr_writer :max_retweets + + # Filter by media type. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetThreadParams::MediaType::OrSymbol + ) + ) + end + attr_reader :media_type + + sig do + params( + media_type: + XTwitterScraper::X::TweetGetThreadParams::MediaType::OrSymbol + ).void + end + attr_writer :media_type + + # Filter tweets mentioning a username. + sig { returns(T.nilable(String)) } + attr_reader :mentioning + + sig { params(mentioning: String).void } + attr_writer :mentioning + + # Minimum bookmark count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_bookmarks + + sig { params(min_bookmarks: Integer).void } + attr_writer :min_bookmarks + + # Minimum likes threshold. minLikes is also accepted. + sig { returns(T.nilable(Integer)) } + attr_reader :min_faves + + sig { params(min_faves: Integer).void } + attr_writer :min_faves + + # Minimum quote count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_quotes + + sig { params(min_quotes: Integer).void } + attr_writer :min_quotes + + # Minimum replies threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_replies + + sig { params(min_replies: Integer).void } + attr_writer :min_replies + + # Minimum retweets threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_retweets + + sig { params(min_retweets: Integer).void } + attr_writer :min_retweets + + # Minimum view count threshold. + sig { returns(T.nilable(Integer)) } + attr_reader :min_views + + sig { params(min_views: Integer).void } + attr_writer :min_views + # Maximum page items (1-100, default 20). Source, filters, or credits can reduce # results. Continue while has_next_page is true. Deprecated limit and count # aliases remain accepted. @@ -38,22 +204,223 @@ module XTwitterScraper sig { params(page_size: Integer).void } attr_writer :page_size + # Quote mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetThreadParams::Quotes::OrSymbol + ) + ) + end + attr_reader :quotes + + sig do + params( + quotes: XTwitterScraper::X::TweetGetThreadParams::Quotes::OrSymbol + ).void + end + attr_writer :quotes + + # Only quotes of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :quotes_of_tweet_id + + sig { params(quotes_of_tweet_id: String).void } + attr_writer :quotes_of_tweet_id + + # Reply mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetThreadParams::Replies::OrSymbol + ) + ) + end + attr_reader :replies + + sig do + params( + replies: XTwitterScraper::X::TweetGetThreadParams::Replies::OrSymbol + ).void + end + attr_writer :replies + + # Retweet mode. + sig do + returns( + T.nilable( + XTwitterScraper::X::TweetGetThreadParams::Retweets::OrSymbol + ) + ) + end + attr_reader :retweets + + sig do + params( + retweets: + XTwitterScraper::X::TweetGetThreadParams::Retweets::OrSymbol + ).void + end + attr_writer :retweets + + # Only retweets of this tweet ID. + sig { returns(T.nilable(String)) } + attr_reader :retweets_of_tweet_id + + sig { params(retweets_of_tweet_id: String).void } + attr_writer :retweets_of_tweet_id + + # Start date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :since_date + + sig { params(since_date: Date).void } + attr_writer :since_date + + # Filter replies sent to a username. + sig { returns(T.nilable(String)) } + attr_reader :to_user + + sig { params(to_user: String).void } + attr_writer :to_user + + # End date in YYYY-MM-DD format. + sig { returns(T.nilable(Date)) } + attr_reader :until_date + + sig { params(until_date: Date).void } + attr_writer :until_date + + # URL substring or domain filter. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Only return tweets from verified authors. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_only + + sig { params(verified_only: T::Boolean).void } + attr_writer :verified_only + sig do params( id: String, + any_words: String, + blue_verified_only: T::Boolean, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + max_faves: Integer, + max_quotes: Integer, + max_replies: Integer, + max_retweets: Integer, + media_type: + XTwitterScraper::X::TweetGetThreadParams::MediaType::OrSymbol, + mentioning: String, + min_bookmarks: Integer, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + min_views: Integer, page_size: Integer, + quotes: XTwitterScraper::X::TweetGetThreadParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetThreadParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetThreadParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(T.attached_class) end def self.new( id:, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Only return tweets from Blue-verified authors. + blue_verified_only: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for thread tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Maximum likes threshold. maxLikes is also accepted. + max_faves: nil, + # Maximum quotes threshold. + max_quotes: nil, + # Maximum replies threshold. + max_replies: nil, + # Maximum retweets threshold. + max_retweets: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum bookmark count threshold. + min_bookmarks: nil, + # Minimum likes threshold. minLikes is also accepted. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Minimum view count threshold. + min_views: nil, # Maximum page items (1-100, default 20). Source, filters, or credits can reduce # results. Continue while has_next_page is true. Deprecated limit and count # aliases remain accepted. page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end @@ -62,14 +429,213 @@ module XTwitterScraper override.returns( { id: String, + any_words: String, + blue_verified_only: T::Boolean, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + max_faves: Integer, + max_quotes: Integer, + max_replies: Integer, + max_retweets: Integer, + media_type: + XTwitterScraper::X::TweetGetThreadParams::MediaType::OrSymbol, + mentioning: String, + min_bookmarks: Integer, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + min_views: Integer, page_size: Integer, + quotes: + XTwitterScraper::X::TweetGetThreadParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetThreadParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetThreadParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions } ) end def to_hash end + + # Filter by media type. + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetThreadParams::MediaType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IMAGES = + T.let( + :images, + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ) + VIDEOS = + T.let( + :videos, + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ) + GIFS = + T.let( + :gifs, + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ) + MEDIA = + T.let( + :media, + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ) + LINKS = + T.let( + :links, + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ) + NONE = + T.let( + :none, + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetThreadParams::MediaType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Quote mode. + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetThreadParams::Quotes) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetThreadParams::Quotes::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetThreadParams::Quotes::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetThreadParams::Quotes::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetThreadParams::Quotes::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reply mode. + module Replies + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetThreadParams::Replies) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetThreadParams::Replies::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetThreadParams::Replies::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetThreadParams::Replies::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetThreadParams::Replies::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Retweet mode. + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetThreadParams::Retweets) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INCLUDE = + T.let( + :include, + XTwitterScraper::X::TweetGetThreadParams::Retweets::TaggedSymbol + ) + EXCLUDE = + T.let( + :exclude, + XTwitterScraper::X::TweetGetThreadParams::Retweets::TaggedSymbol + ) + ONLY = + T.let( + :only, + XTwitterScraper::X::TweetGetThreadParams::Retweets::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetThreadParams::Retweets::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi b/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi index ff14cfb..585b8bd 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_search_params.rbi @@ -220,7 +220,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -597,7 +597,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi index 3ec514f..e32a74b 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi @@ -188,7 +188,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -494,7 +494,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi index 8ca53ff..36667de 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi @@ -188,7 +188,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -494,7 +494,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi index c42d881..aa8c6d9 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi @@ -188,7 +188,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -510,7 +510,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi index 6773639..54bccfd 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi @@ -196,7 +196,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -505,7 +505,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi b/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi index 7170ec1..4eb09ad 100644 --- a/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +++ b/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi @@ -203,7 +203,7 @@ module XTwitterScraper sig { params(min_bookmarks: Integer).void } attr_writer :min_bookmarks - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. sig { returns(T.nilable(Integer)) } attr_reader :min_faves @@ -515,7 +515,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/resources/x/tweets.rbi b/rbi/x_twitter_scraper/resources/x/tweets.rbi index 6f236e1..436c357 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets.rbi @@ -279,7 +279,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, @@ -466,7 +466,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, @@ -600,25 +600,127 @@ module XTwitterScraper sig do params( id: String, + any_words: String, + blue_verified_only: T::Boolean, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + max_faves: Integer, + max_quotes: Integer, + max_replies: Integer, + max_retweets: Integer, + media_type: + XTwitterScraper::X::TweetGetThreadParams::MediaType::OrSymbol, + mentioning: String, + min_bookmarks: Integer, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + min_views: Integer, page_size: Integer, + quotes: XTwitterScraper::X::TweetGetThreadParams::Quotes::OrSymbol, + quotes_of_tweet_id: String, + replies: + XTwitterScraper::X::TweetGetThreadParams::Replies::OrSymbol, + retweets: + XTwitterScraper::X::TweetGetThreadParams::Retweets::OrSymbol, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash ).returns(XTwitterScraper::PaginatedTweets) end def get_thread( # Tweet ID to get thread context id, + # Words or quoted phrases where any one can match. Separate with spaces, commas, + # or lines. + any_words: nil, + # Only return tweets from Blue-verified authors. + blue_verified_only: nil, + # Cashtags separated by spaces, commas, or lines. + cashtags: nil, + # Conversation ID filter. + conversation_id: nil, # Pagination cursor for thread tweets cursor: nil, + # Exact phrase to match. + exact_phrase: nil, + # Words or quoted phrases to exclude. Separate with spaces, commas, or lines. + exclude_words: nil, + # Filter by author username. + from_user: nil, + # Hashtags separated by spaces, commas, or lines. + hashtags: nil, + # Only replies to this tweet ID. + in_reply_to_tweet_id: nil, + # Language code filter, e.g. en or tr. + language: nil, + # Maximum likes threshold. maxLikes is also accepted. + max_faves: nil, + # Maximum quotes threshold. + max_quotes: nil, + # Maximum replies threshold. + max_replies: nil, + # Maximum retweets threshold. + max_retweets: nil, + # Filter by media type. + media_type: nil, + # Filter tweets mentioning a username. + mentioning: nil, + # Minimum bookmark count threshold. + min_bookmarks: nil, + # Minimum likes threshold. minLikes is also accepted. + min_faves: nil, + # Minimum quote count threshold. + min_quotes: nil, + # Minimum replies threshold. + min_replies: nil, + # Minimum retweets threshold. + min_retweets: nil, + # Minimum view count threshold. + min_views: nil, # Maximum page items (1-100, default 20). Source, filters, or credits can reduce # results. Continue while has_next_page is true. Deprecated limit and count # aliases remain accepted. page_size: nil, + # Quote mode. + quotes: nil, + # Only quotes of this tweet ID. + quotes_of_tweet_id: nil, + # Reply mode. + replies: nil, + # Retweet mode. + retweets: nil, + # Only retweets of this tweet ID. + retweets_of_tweet_id: nil, + # Start date in YYYY-MM-DD format. + since_date: nil, + # Filter replies sent to a username. + to_user: nil, + # End date in YYYY-MM-DD format. + until_date: nil, + # URL substring or domain filter. + url: nil, + # Only return tweets from verified authors. + verified_only: nil, request_options: {} ) end - # No-mode search maximizes coverage. + # No-mode search maximizes coverage. New cursorless `Latest` sessions return rows + # newest-first across cursor pages. Existing cursors preserve their established + # ordering. sig do params( q: String, @@ -742,7 +844,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index 78dcaef..88cea58 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -389,7 +389,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, @@ -548,7 +548,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, @@ -709,7 +709,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, @@ -878,7 +878,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, @@ -1103,7 +1103,7 @@ module XTwitterScraper mentioning: nil, # Minimum bookmark count threshold. min_bookmarks: nil, - # Minimum likes threshold. + # Minimum likes threshold. minLikes is also accepted. min_faves: nil, # Minimum quote count threshold. min_quotes: nil, diff --git a/sig/x_twitter_scraper/models/error.rbs b/sig/x_twitter_scraper/models/error.rbs index 3b50c52..14f7d11 100644 --- a/sig/x_twitter_scraper/models/error.rbs +++ b/sig/x_twitter_scraper/models/error.rbs @@ -112,12 +112,17 @@ module XTwitterScraper | :idempotency_conflict | :idempotency_key_conflict | :invalid_community_id + | :invalid_complete_replies_request | :invalid_coverage_cursor + | :invalid_coverage_request | :invalid_idempotency_key | :invalid_list_id + | :invalid_output_options | :invalid_payment_amount | :invalid_range + | :invalid_reply_options | :login_rate_limited + | :login_service_unavailable | :missing_idempotency_key | :missing_ids | :no_cached_style @@ -128,6 +133,7 @@ module XTwitterScraper | :support_media_rate_limit | :support_request_rate_limit | :too_many_ids + | :too_many_tweets | :unknown_field | :unsupported_media_type | :webhook_inactive @@ -219,12 +225,17 @@ module XTwitterScraper IDEMPOTENCY_CONFLICT: :idempotency_conflict IDEMPOTENCY_KEY_CONFLICT: :idempotency_key_conflict INVALID_COMMUNITY_ID: :invalid_community_id + INVALID_COMPLETE_REPLIES_REQUEST: :invalid_complete_replies_request INVALID_COVERAGE_CURSOR: :invalid_coverage_cursor + INVALID_COVERAGE_REQUEST: :invalid_coverage_request INVALID_IDEMPOTENCY_KEY: :invalid_idempotency_key INVALID_LIST_ID: :invalid_list_id + INVALID_OUTPUT_OPTIONS: :invalid_output_options INVALID_PAYMENT_AMOUNT: :invalid_payment_amount INVALID_RANGE: :invalid_range + INVALID_REPLY_OPTIONS: :invalid_reply_options LOGIN_RATE_LIMITED: :login_rate_limited + LOGIN_SERVICE_UNAVAILABLE: :login_service_unavailable MISSING_IDEMPOTENCY_KEY: :missing_idempotency_key MISSING_IDS: :missing_ids NO_CACHED_STYLE: :no_cached_style @@ -235,6 +246,7 @@ module XTwitterScraper SUPPORT_MEDIA_RATE_LIMIT: :support_media_rate_limit SUPPORT_REQUEST_RATE_LIMIT: :support_request_rate_limit TOO_MANY_IDS: :too_many_ids + TOO_MANY_TWEETS: :too_many_tweets UNKNOWN_FIELD: :unknown_field UNSUPPORTED_MEDIA_TYPE: :unsupported_media_type WEBHOOK_INACTIVE: :webhook_inactive @@ -353,12 +365,17 @@ module XTwitterScraper | :idempotency_conflict | :idempotency_key_conflict | :invalid_community_id + | :invalid_complete_replies_request | :invalid_coverage_cursor + | :invalid_coverage_request | :invalid_idempotency_key | :invalid_list_id + | :invalid_output_options | :invalid_payment_amount | :invalid_range + | :invalid_reply_options | :login_rate_limited + | :login_service_unavailable | :missing_idempotency_key | :missing_ids | :no_cached_style @@ -369,6 +386,7 @@ module XTwitterScraper | :support_media_rate_limit | :support_request_rate_limit | :too_many_ids + | :too_many_tweets | :unknown_field | :unsupported_media_type | :webhook_inactive @@ -460,12 +478,17 @@ module XTwitterScraper IDEMPOTENCY_CONFLICT: :idempotency_conflict IDEMPOTENCY_KEY_CONFLICT: :idempotency_key_conflict INVALID_COMMUNITY_ID: :invalid_community_id + INVALID_COMPLETE_REPLIES_REQUEST: :invalid_complete_replies_request INVALID_COVERAGE_CURSOR: :invalid_coverage_cursor + INVALID_COVERAGE_REQUEST: :invalid_coverage_request INVALID_IDEMPOTENCY_KEY: :invalid_idempotency_key INVALID_LIST_ID: :invalid_list_id + INVALID_OUTPUT_OPTIONS: :invalid_output_options INVALID_PAYMENT_AMOUNT: :invalid_payment_amount INVALID_RANGE: :invalid_range + INVALID_REPLY_OPTIONS: :invalid_reply_options LOGIN_RATE_LIMITED: :login_rate_limited + LOGIN_SERVICE_UNAVAILABLE: :login_service_unavailable MISSING_IDEMPOTENCY_KEY: :missing_idempotency_key MISSING_IDS: :missing_ids NO_CACHED_STYLE: :no_cached_style @@ -476,6 +499,7 @@ module XTwitterScraper SUPPORT_MEDIA_RATE_LIMIT: :support_media_rate_limit SUPPORT_REQUEST_RATE_LIMIT: :support_request_rate_limit TOO_MANY_IDS: :too_many_ids + TOO_MANY_TWEETS: :too_many_tweets UNKNOWN_FIELD: :unknown_field UNSUPPORTED_MEDIA_TYPE: :unsupported_media_type WEBHOOK_INACTIVE: :webhook_inactive diff --git a/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs index 36b3e9c..03d5d44 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_thread_params.rbs @@ -6,7 +6,43 @@ module XTwitterScraper module Models module X type tweet_get_thread_params = - { id: String, cursor: String, page_size: Integer } + { + id: String, + any_words: String, + blue_verified_only: bool, + cashtags: String, + conversation_id: String, + cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + max_faves: Integer, + max_quotes: Integer, + max_replies: Integer, + max_retweets: Integer, + media_type: XTwitterScraper::Models::X::TweetGetThreadParams::media_type, + mentioning: String, + min_bookmarks: Integer, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + min_views: Integer, + page_size: Integer, + quotes: XTwitterScraper::Models::X::TweetGetThreadParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetGetThreadParams::replies, + retweets: XTwitterScraper::Models::X::TweetGetThreadParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool + } & XTwitterScraper::Internal::Type::request_parameters class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel @@ -15,27 +51,278 @@ module XTwitterScraper attr_accessor id: String + attr_reader any_words: String? + + def any_words=: (String) -> String + + attr_reader blue_verified_only: bool? + + def blue_verified_only=: (bool) -> bool + + attr_reader cashtags: String? + + def cashtags=: (String) -> String + + attr_reader conversation_id: String? + + def conversation_id=: (String) -> String + attr_reader cursor: String? def cursor=: (String) -> String + attr_reader exact_phrase: String? + + def exact_phrase=: (String) -> String + + attr_reader exclude_words: String? + + def exclude_words=: (String) -> String + + attr_reader from_user: String? + + def from_user=: (String) -> String + + attr_reader hashtags: String? + + def hashtags=: (String) -> String + + attr_reader in_reply_to_tweet_id: String? + + def in_reply_to_tweet_id=: (String) -> String + + attr_reader language: String? + + def language=: (String) -> String + + attr_reader max_faves: Integer? + + def max_faves=: (Integer) -> Integer + + attr_reader max_quotes: Integer? + + def max_quotes=: (Integer) -> Integer + + attr_reader max_replies: Integer? + + def max_replies=: (Integer) -> Integer + + attr_reader max_retweets: Integer? + + def max_retweets=: (Integer) -> Integer + + attr_reader media_type: XTwitterScraper::Models::X::TweetGetThreadParams::media_type? + + def media_type=: ( + XTwitterScraper::Models::X::TweetGetThreadParams::media_type + ) -> XTwitterScraper::Models::X::TweetGetThreadParams::media_type + + attr_reader mentioning: String? + + def mentioning=: (String) -> String + + attr_reader min_bookmarks: Integer? + + def min_bookmarks=: (Integer) -> Integer + + attr_reader min_faves: Integer? + + def min_faves=: (Integer) -> Integer + + attr_reader min_quotes: Integer? + + def min_quotes=: (Integer) -> Integer + + attr_reader min_replies: Integer? + + def min_replies=: (Integer) -> Integer + + attr_reader min_retweets: Integer? + + def min_retweets=: (Integer) -> Integer + + attr_reader min_views: Integer? + + def min_views=: (Integer) -> Integer + attr_reader page_size: Integer? def page_size=: (Integer) -> Integer + attr_reader quotes: XTwitterScraper::Models::X::TweetGetThreadParams::quotes? + + def quotes=: ( + XTwitterScraper::Models::X::TweetGetThreadParams::quotes + ) -> XTwitterScraper::Models::X::TweetGetThreadParams::quotes + + attr_reader quotes_of_tweet_id: String? + + def quotes_of_tweet_id=: (String) -> String + + attr_reader replies: XTwitterScraper::Models::X::TweetGetThreadParams::replies? + + def replies=: ( + XTwitterScraper::Models::X::TweetGetThreadParams::replies + ) -> XTwitterScraper::Models::X::TweetGetThreadParams::replies + + attr_reader retweets: XTwitterScraper::Models::X::TweetGetThreadParams::retweets? + + def retweets=: ( + XTwitterScraper::Models::X::TweetGetThreadParams::retweets + ) -> XTwitterScraper::Models::X::TweetGetThreadParams::retweets + + attr_reader retweets_of_tweet_id: String? + + def retweets_of_tweet_id=: (String) -> String + + attr_reader since_date: Date? + + def since_date=: (Date) -> Date + + attr_reader to_user: String? + + def to_user=: (String) -> String + + attr_reader until_date: Date? + + def until_date=: (Date) -> Date + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader verified_only: bool? + + def verified_only=: (bool) -> bool + def initialize: ( id: String, + ?any_words: String, + ?blue_verified_only: bool, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?max_faves: Integer, + ?max_quotes: Integer, + ?max_replies: Integer, + ?max_retweets: Integer, + ?media_type: XTwitterScraper::Models::X::TweetGetThreadParams::media_type, + ?mentioning: String, + ?min_bookmarks: Integer, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?min_views: Integer, ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::TweetGetThreadParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetGetThreadParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetGetThreadParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> void def to_hash: -> { id: String, + any_words: String, + blue_verified_only: bool, + cashtags: String, + conversation_id: String, cursor: String, + exact_phrase: String, + exclude_words: String, + from_user: String, + hashtags: String, + in_reply_to_tweet_id: String, + language: String, + max_faves: Integer, + max_quotes: Integer, + max_replies: Integer, + max_retweets: Integer, + media_type: XTwitterScraper::Models::X::TweetGetThreadParams::media_type, + mentioning: String, + min_bookmarks: Integer, + min_faves: Integer, + min_quotes: Integer, + min_replies: Integer, + min_retweets: Integer, + min_views: Integer, page_size: Integer, + quotes: XTwitterScraper::Models::X::TweetGetThreadParams::quotes, + quotes_of_tweet_id: String, + replies: XTwitterScraper::Models::X::TweetGetThreadParams::replies, + retweets: XTwitterScraper::Models::X::TweetGetThreadParams::retweets, + retweets_of_tweet_id: String, + since_date: Date, + to_user: String, + until_date: Date, + url: String, + verified_only: bool, request_options: XTwitterScraper::RequestOptions } + + type media_type = :images | :videos | :gifs | :media | :links | :none + + module MediaType + extend XTwitterScraper::Internal::Type::Enum + + IMAGES: :images + VIDEOS: :videos + GIFS: :gifs + MEDIA: :media + LINKS: :links + NONE: :none + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetThreadParams::media_type] + end + + type quotes = :include | :exclude | :only + + module Quotes + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetThreadParams::quotes] + end + + type replies = :include | :exclude | :only + + module Replies + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetThreadParams::replies] + end + + type retweets = :include | :exclude | :only + + module Retweets + extend XTwitterScraper::Internal::Type::Enum + + INCLUDE: :include + EXCLUDE: :exclude + ONLY: :only + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetThreadParams::retweets] + end end end end diff --git a/sig/x_twitter_scraper/resources/x/tweets.rbs b/sig/x_twitter_scraper/resources/x/tweets.rbs index 5ce36c8..c54eefe 100644 --- a/sig/x_twitter_scraper/resources/x/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets.rbs @@ -197,8 +197,40 @@ module XTwitterScraper def get_thread: ( String id, + ?any_words: String, + ?blue_verified_only: bool, + ?cashtags: String, + ?conversation_id: String, ?cursor: String, + ?exact_phrase: String, + ?exclude_words: String, + ?from_user: String, + ?hashtags: String, + ?in_reply_to_tweet_id: String, + ?language: String, + ?max_faves: Integer, + ?max_quotes: Integer, + ?max_replies: Integer, + ?max_retweets: Integer, + ?media_type: XTwitterScraper::Models::X::TweetGetThreadParams::media_type, + ?mentioning: String, + ?min_bookmarks: Integer, + ?min_faves: Integer, + ?min_quotes: Integer, + ?min_replies: Integer, + ?min_retweets: Integer, + ?min_views: Integer, ?page_size: Integer, + ?quotes: XTwitterScraper::Models::X::TweetGetThreadParams::quotes, + ?quotes_of_tweet_id: String, + ?replies: XTwitterScraper::Models::X::TweetGetThreadParams::replies, + ?retweets: XTwitterScraper::Models::X::TweetGetThreadParams::retweets, + ?retweets_of_tweet_id: String, + ?since_date: Date, + ?to_user: String, + ?until_date: Date, + ?url: String, + ?verified_only: bool, ?request_options: XTwitterScraper::request_opts ) -> XTwitterScraper::PaginatedTweets From cd74a848aac338f4caea2343648f1838cc2804e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 10:59:59 +0000 Subject: [PATCH 2/2] release: 0.10.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/x_twitter_scraper/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b28fea9..7d9b009 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.1" + ".": "0.10.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b1a027..16f4eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.10.0 (2026-08-12) + +Full Changelog: [v0.9.1...v0.10.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.9.1...v0.10.0) + +### Features + +* **api:** sync public contracts ([b7fafe0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/b7fafe0efcf6b27464565ca4c54159c2276cb58a)) + ## 0.9.1 (2026-08-11) Full Changelog: [v0.9.0...v0.9.1](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.9.0...v0.9.1) diff --git a/Gemfile.lock b/Gemfile.lock index eecd7ba..fe8535a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - x-twitter-scraper (0.9.1) + x-twitter-scraper (0.10.0) base64 cgi connection_pool diff --git a/README.md b/README.md index 22258e7..0662bb6 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Add the gem to your `Gemfile`: ```ruby -gem "x-twitter-scraper", "~> 0.9.1" +gem "x-twitter-scraper", "~> 0.10.0" ``` diff --git a/lib/x_twitter_scraper/version.rb b/lib/x_twitter_scraper/version.rb index 7a8fd39..7c8ae3f 100644 --- a/lib/x_twitter_scraper/version.rb +++ b/lib/x_twitter_scraper/version.rb @@ -5,5 +5,5 @@ # frozen_string_literal: true module XTwitterScraper - VERSION = "0.9.1" + VERSION = "0.10.0" end