From d03581fab0d298ad933f6abc6fc6e94461c56e20 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 13:30:42 +0000 Subject: [PATCH 1/2] feat(api): align reply extraction contracts Regenerate every SDK from the exact production OpenAPI contract. --- .stats.yml | 4 +- lib/x_twitter_scraper.rb | 3 +- lib/x_twitter_scraper/internal/type/union.rb | 30 +- .../models/content_disclosure.rb | 10 +- .../models/embedded_tweet.rb | 390 +++++++++- .../models/paginated_tweets.rb | 9 +- lib/x_twitter_scraper/models/search_tweet.rb | 372 ++++++++- .../models/support/ticket_list_response.rb | 47 +- .../support/ticket_retrieve_response.rb | 73 +- .../models/support/ticket_update_response.rb | 24 +- .../models/trend_list_response.rb | 29 +- lib/x_twitter_scraper/models/tweet_media.rb | 214 +++++- lib/x_twitter_scraper/models/user_profile.rb | 232 +++++- ...nt_connection_attempt_retrieve_response.rb | 57 +- ...nt_connection_challenge_submit_response.rb | 8 +- .../models/x/account_create_response.rb | 151 +++- .../models/x/account_reauth_response.rb | 8 +- .../tweet_list_by_community_params.rb | 8 +- .../models/x/communities/tweet_list_params.rb | 8 +- .../x/community_retrieve_info_response.rb | 18 +- .../x/community_retrieve_search_params.rb | 8 +- .../models/x/list_retrieve_tweets_params.rb | 8 +- .../models/x/tweet_author.rb | 15 +- .../models/x/tweet_detail.rb | 374 ++++++++- .../models/x/tweet_get_quotes_params.rb | 8 +- .../models/x/tweet_get_replies_params.rb | 40 +- .../models/x/tweet_get_replies_response.rb | 345 +++++++++ .../models/x/tweet_get_thread_params.rb | 8 +- .../models/x/user_retrieve_likes_params.rb | 8 +- .../models/x/user_retrieve_media_params.rb | 8 +- .../models/x/user_retrieve_mentions_params.rb | 8 +- .../models/x/user_retrieve_replies_params.rb | 8 +- .../models/x/user_retrieve_tweets_params.rb | 8 +- .../models/x_get_article_response.rb | 8 +- .../models/x_get_trends_response.rb | 29 +- .../x/account_connection_attempts.rb | 2 +- lib/x_twitter_scraper/resources/x/accounts.rb | 4 +- .../resources/x/communities.rb | 2 +- .../resources/x/communities/tweets.rb | 4 +- lib/x_twitter_scraper/resources/x/lists.rb | 2 +- lib/x_twitter_scraper/resources/x/tweets.rb | 25 +- lib/x_twitter_scraper/resources/x/users.rb | 10 +- .../models/content_disclosure.rbi | 16 +- .../models/embedded_tweet.rbi | 711 +++++++++++++++++- .../models/paginated_tweets.rbi | 9 +- rbi/x_twitter_scraper/models/search_tweet.rbi | 677 ++++++++++++++++- .../models/support/ticket_list_response.rbi | 130 ++-- .../support/ticket_retrieve_response.rbi | 216 +++--- .../models/support/ticket_update_response.rbi | 75 +- .../models/trend_list_response.rbi | 43 +- rbi/x_twitter_scraper/models/tweet_media.rbi | 316 +++++++- rbi/x_twitter_scraper/models/user_profile.rbi | 369 ++++++++- ...t_connection_attempt_retrieve_response.rbi | 117 +-- ...t_connection_challenge_submit_response.rbi | 12 +- .../models/x/account_create_response.rbi | 266 ++++++- .../models/x/account_reauth_response.rbi | 12 +- .../tweet_list_by_community_params.rbi | 12 +- .../x/communities/tweet_list_params.rbi | 12 +- .../x/community_retrieve_info_response.rbi | 22 - .../x/community_retrieve_search_params.rbi | 12 +- .../models/x/list_retrieve_tweets_params.rbi | 12 +- .../models/x/tweet_author.rbi | 16 +- .../models/x/tweet_detail.rbi | 693 ++++++++++++++++- .../models/x/tweet_get_quotes_params.rbi | 12 +- .../models/x/tweet_get_replies_params.rbi | 76 +- .../models/x/tweet_get_replies_response.rbi | 527 +++++++++++++ .../models/x/tweet_get_thread_params.rbi | 12 +- .../models/x/user_retrieve_likes_params.rbi | 12 +- .../models/x/user_retrieve_media_params.rbi | 12 +- .../x/user_retrieve_mentions_params.rbi | 12 +- .../models/x/user_retrieve_replies_params.rbi | 12 +- .../models/x/user_retrieve_tweets_params.rbi | 12 +- .../models/x_get_article_response.rbi | 9 - .../models/x_get_trends_response.rbi | 43 +- .../resources/x/accounts.rbi | 2 +- .../resources/x/communities.rbi | 6 +- .../resources/x/communities/tweets.rbi | 12 +- rbi/x_twitter_scraper/resources/x/lists.rbi | 6 +- rbi/x_twitter_scraper/resources/x/tweets.rbi | 38 +- rbi/x_twitter_scraper/resources/x/users.rbi | 30 +- .../models/content_disclosure.rbs | 12 +- .../models/embedded_tweet.rbs | 457 ++++++++++- sig/x_twitter_scraper/models/search_tweet.rbs | 439 ++++++++++- .../models/support/ticket_list_response.rbs | 61 +- .../support/ticket_retrieve_response.rbs | 97 +-- .../models/support/ticket_update_response.rbs | 32 +- .../models/trend_list_response.rbs | 28 +- sig/x_twitter_scraper/models/tweet_media.rbs | 180 ++++- sig/x_twitter_scraper/models/user_profile.rbs | 238 +++++- ...t_connection_attempt_retrieve_response.rbs | 62 +- ...t_connection_challenge_submit_response.rbs | 10 +- .../models/x/account_create_response.rbs | 148 +++- .../models/x/account_reauth_response.rbs | 10 +- .../x/community_retrieve_info_response.rbs | 14 - .../models/x/tweet_author.rbs | 14 +- .../models/x/tweet_detail.rbs | 439 ++++++++++- .../models/x/tweet_get_replies_params.rbs | 26 + .../models/x/tweet_get_replies_response.rbs | 274 +++++++ .../models/x_get_article_response.rbs | 7 - .../models/x_get_trends_response.rbs | 28 +- .../resources/x/accounts.rbs | 2 +- sig/x_twitter_scraper/resources/x/tweets.rbs | 4 +- .../resources/support/tickets_test.rb | 18 +- .../x/account_connection_attempts_test.rb | 24 +- .../x/account_connection_challenges_test.rb | 2 +- .../resources/x/accounts_test.rb | 12 +- .../resources/x/tweets_test.rb | 10 +- .../resources/x/users_test.rb | 18 +- 108 files changed, 8865 insertions(+), 1009 deletions(-) create mode 100644 lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb create mode 100644 rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi create mode 100644 sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs diff --git a/.stats.yml b/.stats.yml index 722a8b3..ec9dedf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 123 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-323137ebb1ee9824cd9cfb63a325c0839deb81f17244e42e8154d6567e7af954.yml -openapi_spec_hash: 48da9c2747c1e7c474dd514d39c28c49 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-5f26f3694399b4ac5a4431c66f7d27c4024f9d0dcd899702de5fde1150e28330.yml +openapi_spec_hash: 362e24e622f9a74ded8b38018e50460c config_hash: dab26921eb273c16e5570c0485c9ac2c diff --git a/lib/x_twitter_scraper.rb b/lib/x_twitter_scraper.rb index 7bad21b..146d4e5 100644 --- a/lib/x_twitter_scraper.rb +++ b/lib/x_twitter_scraper.rb @@ -57,6 +57,7 @@ require_relative "x_twitter_scraper/internal/transport/pooled_net_requester" require_relative "x_twitter_scraper/client" require_relative "x_twitter_scraper/models/user_profile" +require_relative "x_twitter_scraper/models/paginated_tweets" require_relative "x_twitter_scraper/models/account_retrieve_params" require_relative "x_twitter_scraper/models/account_retrieve_response" require_relative "x_twitter_scraper/models/account_set_x_username_params" @@ -134,7 +135,6 @@ require_relative "x_twitter_scraper/models/monitors/keyword_update_params" require_relative "x_twitter_scraper/models/monitors/keyword_update_response" require_relative "x_twitter_scraper/models/monitor_update_params" -require_relative "x_twitter_scraper/models/paginated_tweets" require_relative "x_twitter_scraper/models/paginated_users" require_relative "x_twitter_scraper/models/radar_item" require_relative "x_twitter_scraper/models/radar_retrieve_trending_topics_params" @@ -243,6 +243,7 @@ require_relative "x_twitter_scraper/models/x/tweet_get_favoriters_params" require_relative "x_twitter_scraper/models/x/tweet_get_quotes_params" require_relative "x_twitter_scraper/models/x/tweet_get_replies_params" +require_relative "x_twitter_scraper/models/x/tweet_get_replies_response" require_relative "x_twitter_scraper/models/x/tweet_get_retweeters_params" require_relative "x_twitter_scraper/models/x/tweet_get_thread_params" require_relative "x_twitter_scraper/models/x/tweet_list_params" diff --git a/lib/x_twitter_scraper/internal/type/union.rb b/lib/x_twitter_scraper/internal/type/union.rb index f71f0a6..4cc3730 100644 --- a/lib/x_twitter_scraper/internal/type/union.rb +++ b/lib/x_twitter_scraper/internal/type/union.rb @@ -10,16 +10,28 @@ module Type # @api private # # @example - # # `compose_create_response` is a `XTwitterScraper::Models::ComposeCreateResponse` - # case compose_create_response - # when XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult - # puts(compose_create_response.content_rules) - # when XTwitterScraper::Models::ComposeCreateResponse::ComposeRefineResult - # puts(compose_create_response.composition_guidance) - # when XTwitterScraper::Models::ComposeCreateResponse::ComposeScoreResult - # puts(compose_create_response.checklist) + # # `account_connection_attempt_retrieve_response` is a `XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse` + # case account_connection_attempt_retrieve_response + # when XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending + # puts(account_connection_attempt_retrieve_response.id) + # when XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success + # puts(account_connection_attempt_retrieve_response.object) + # when XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed + # puts(account_connection_attempt_retrieve_response.error) # else - # puts(compose_create_response) + # puts(account_connection_attempt_retrieve_response) + # end + # + # @example + # case account_connection_attempt_retrieve_response + # in {status: :pending, id: id, object: object, poll_after_ms: poll_after_ms} + # puts(id) + # in {status: :success, id: id, object: object} + # puts(object) + # in {status: :failed, id: id, error: error, object: object} + # puts(error) + # else + # puts(account_connection_attempt_retrieve_response) # end module Union include XTwitterScraper::Internal::Type::Converter diff --git a/lib/x_twitter_scraper/models/content_disclosure.rb b/lib/x_twitter_scraper/models/content_disclosure.rb index 6d348fb..8324777 100644 --- a/lib/x_twitter_scraper/models/content_disclosure.rb +++ b/lib/x_twitter_scraper/models/content_disclosure.rb @@ -38,12 +38,6 @@ class Advertising < XTwitterScraper::Internal::Type::BaseModel # @see XTwitterScraper::Models::ContentDisclosure#ai_generated class AIGenerated < XTwitterScraper::Internal::Type::BaseModel - # @!attribute can_edit - # Whether the disclosure can be edited on X. - # - # @return [Boolean, nil] - optional :can_edit, XTwitterScraper::Internal::Type::Boolean, api_name: :canEdit - # @!attribute detection_source # Source of the AI-generated media disclosure. # @@ -58,9 +52,7 @@ class AIGenerated < XTwitterScraper::Internal::Type::BaseModel XTwitterScraper::Internal::Type::Boolean, api_name: :hasAiGeneratedMedia - # @!method initialize(can_edit: nil, detection_source: nil, has_ai_generated_media: nil) - # @param can_edit [Boolean] Whether the disclosure can be edited on X. - # + # @!method initialize(detection_source: nil, has_ai_generated_media: nil) # @param detection_source [String] Source of the AI-generated media disclosure. # # @param has_ai_generated_media [Boolean] True when X labels the tweet as containing AI-generated media. diff --git a/lib/x_twitter_scraper/models/embedded_tweet.rb b/lib/x_twitter_scraper/models/embedded_tweet.rb index 5acf10a..790e699 100644 --- a/lib/x_twitter_scraper/models/embedded_tweet.rb +++ b/lib/x_twitter_scraper/models/embedded_tweet.rb @@ -47,12 +47,30 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Integer] required :view_count, Integer, api_name: :viewCount + # @!attribute article + # Article metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::Article, nil] + optional :article, -> { XTwitterScraper::EmbeddedTweet::Article } + # @!attribute author # X user profile with bio, follower counts, and verification status. # # @return [XTwitterScraper::Models::UserProfile, nil] optional :author, -> { XTwitterScraper::UserProfile } + # @!attribute card + # Public card metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::Card, nil] + optional :card, -> { XTwitterScraper::EmbeddedTweet::Card } + + # @!attribute community_note + # Community Note presentation metadata returned by X. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::CommunityNote, nil] + optional :community_note, -> { XTwitterScraper::EmbeddedTweet::CommunityNote }, api_name: :communityNote + # @!attribute content_disclosure # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. @@ -77,6 +95,12 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel XTwitterScraper::Internal::Type::ArrayOf[Integer], api_name: :displayTextRange + # @!attribute edit + # Edit history metadata returned by X. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::Edit, nil] + optional :edit, -> { XTwitterScraper::EmbeddedTweet::Edit } + # @!attribute entities # # @return [Hash{Symbol=>Object}, nil] @@ -117,6 +141,11 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply + # @!attribute is_translatable + # + # @return [Boolean, nil] + optional :is_translatable, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslatable + # @!attribute lang # # @return [String, nil] @@ -127,6 +156,47 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Array, nil] optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] } + # @!attribute note_tweet + # Complete Note Tweet content and rich-text metadata. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::NoteTweet, nil] + optional :note_tweet, -> { XTwitterScraper::EmbeddedTweet::NoteTweet }, api_name: :noteTweet + + # @!attribute place + # Public place metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::Place, nil] + optional :place, -> { XTwitterScraper::EmbeddedTweet::Place } + + # @!attribute possibly_sensitive + # + # @return [Boolean, nil] + optional :possibly_sensitive, XTwitterScraper::Internal::Type::Boolean, api_name: :possiblySensitive + + # @!attribute previous_counts + # Engagement counts retained from a prior tweet edit. + # + # @return [XTwitterScraper::Models::EmbeddedTweet::PreviousCounts, nil] + optional :previous_counts, + -> { XTwitterScraper::EmbeddedTweet::PreviousCounts }, + api_name: :previousCounts + + # @!attribute quoted_tweet + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + # + # @return [XTwitterScraper::Models::EmbeddedTweet, nil] + optional :quoted_tweet, -> { XTwitterScraper::EmbeddedTweet } + + # @!attribute retweeted_tweet + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + # + # @return [XTwitterScraper::Models::EmbeddedTweet, nil] + optional :retweeted_tweet, -> { XTwitterScraper::EmbeddedTweet } + # @!attribute source # # @return [String, nil] @@ -142,7 +212,12 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :url, String - # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, author: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, lang: nil, media: nil, source: nil, type: nil, url: nil) + # @!attribute view_state + # + # @return [String, nil] + optional :view_state, String, api_name: :viewState + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, article: nil, author: nil, card: nil, community_note: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, edit: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, is_translatable: nil, lang: nil, media: nil, note_tweet: nil, place: nil, possibly_sensitive: nil, previous_counts: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil, view_state: nil) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::EmbeddedTweet} for more details. # @@ -166,8 +241,14 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # # @param view_count [Integer] # + # @param article [XTwitterScraper::Models::EmbeddedTweet::Article] Article metadata attached to a tweet. + # # @param author [XTwitterScraper::Models::UserProfile] X user profile with bio, follower counts, and verification status. # + # @param card [XTwitterScraper::Models::EmbeddedTweet::Card] Public card metadata attached to a tweet. + # + # @param community_note [XTwitterScraper::Models::EmbeddedTweet::CommunityNote] Community Note presentation metadata returned by X. + # # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh # # @param conversation_id [String] @@ -176,6 +257,8 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # # @param display_text_range [Array] # + # @param edit [XTwitterScraper::Models::EmbeddedTweet::Edit] Edit history metadata returned by X. + # # @param entities [Hash{Symbol=>Object}] # # @param in_reply_to_id [String] @@ -192,15 +275,320 @@ class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel # # @param is_reply [Boolean] # + # @param is_translatable [Boolean] + # # @param lang [String] # # @param media [Array] # + # @param note_tweet [XTwitterScraper::Models::EmbeddedTweet::NoteTweet] Complete Note Tweet content and rich-text metadata. + # + # @param place [XTwitterScraper::Models::EmbeddedTweet::Place] Public place metadata attached to a tweet. + # + # @param possibly_sensitive [Boolean] + # + # @param previous_counts [XTwitterScraper::Models::EmbeddedTweet::PreviousCounts] Engagement counts retained from a prior tweet edit. + # + # @param quoted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen + # + # @param retweeted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen + # # @param source [String] # # @param type [String] # # @param url [String] + # + # @param view_state [String] + + # @see XTwitterScraper::Models::EmbeddedTweet#article + class Article < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute cover_media_url + # + # @return [String, nil] + optional :cover_media_url, String, api_name: :coverMediaUrl + + # @!attribute preview_text + # + # @return [String, nil] + optional :preview_text, String, api_name: :previewText + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!method initialize(id: nil, cover_media_url: nil, preview_text: nil, title: nil) + # Article metadata attached to a tweet. + # + # @param id [String] + # @param cover_media_url [String] + # @param preview_text [String] + # @param title [String] + end + + # @see XTwitterScraper::Models::EmbeddedTweet#card + class Card < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute binding_values + # + # @return [Hash{Symbol=>Object}, nil] + optional :binding_values, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + api_name: :bindingValues + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id: nil, binding_values: nil, name: nil, url: nil) + # Public card metadata attached to a tweet. + # + # @param id [String] + # @param binding_values [Hash{Symbol=>Object}] + # @param name [String] + # @param url [String] + end + + # @see XTwitterScraper::Models::EmbeddedTweet#community_note + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute destination_url + # + # @return [String, nil] + optional :destination_url, String, api_name: :destinationUrl + + # @!attribute footer + # + # @return [String, nil] + optional :footer, String + + # @!attribute short_title + # + # @return [String, nil] + optional :short_title, String, api_name: :shortTitle + + # @!attribute subtitle + # + # @return [String, nil] + optional :subtitle, String + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!attribute visual_style + # + # @return [String, nil] + optional :visual_style, String, api_name: :visualStyle + + # @!method initialize(id: nil, destination_url: nil, footer: nil, short_title: nil, subtitle: nil, title: nil, visual_style: nil) + # Community Note presentation metadata returned by X. + # + # @param id [String] + # @param destination_url [String] + # @param footer [String] + # @param short_title [String] + # @param subtitle [String] + # @param title [String] + # @param visual_style [String] + end + + # @see XTwitterScraper::Models::EmbeddedTweet#edit + class Edit < XTwitterScraper::Internal::Type::BaseModel + # @!attribute editable_until_msecs + # + # @return [String, nil] + optional :editable_until_msecs, String, api_name: :editableUntilMsecs + + # @!attribute edit_tweet_ids + # + # @return [Array, nil] + optional :edit_tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :editTweetIds + + # @!method initialize(editable_until_msecs: nil, edit_tweet_ids: nil) + # Edit history metadata returned by X. + # + # @param editable_until_msecs [String] + # @param edit_tweet_ids [Array] + end + + # @see XTwitterScraper::Models::EmbeddedTweet#note_tweet + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + # @!attribute text + # + # @return [String] + required :text, String + + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute entities + # + # @return [Hash{Symbol=>Object}, nil] + optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute is_expandable + # + # @return [Boolean, nil] + optional :is_expandable, XTwitterScraper::Internal::Type::Boolean, api_name: :isExpandable + + # @!attribute richtext_tags + # + # @return [Array, nil] + optional :richtext_tags, + -> { + XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + }, + api_name: :richtextTags + + # @!method initialize(text:, id: nil, entities: nil, is_expandable: nil, richtext_tags: nil) + # Complete Note Tweet content and rich-text metadata. + # + # @param text [String] + # @param id [String] + # @param entities [Hash{Symbol=>Object}] + # @param is_expandable [Boolean] + # @param richtext_tags [Array] + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + # @!attribute from_index + # + # @return [Integer] + required :from_index, Integer, api_name: :fromIndex + + # @!attribute to_index + # + # @return [Integer] + required :to_index, Integer, api_name: :toIndex + + # @!attribute types + # + # @return [Array] + required :types, XTwitterScraper::Internal::Type::ArrayOf[String] + + # @!method initialize(from_index:, to_index:, types:) + # @param from_index [Integer] + # @param to_index [Integer] + # @param types [Array] + end + end + + # @see XTwitterScraper::Models::EmbeddedTweet#place + class Place < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute bounding_box + # + # @return [Hash{Symbol=>Object}, nil] + optional :bounding_box, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + api_name: :boundingBox + + # @!attribute country + # + # @return [String, nil] + optional :country, String + + # @!attribute country_code + # + # @return [String, nil] + optional :country_code, String, api_name: :countryCode + + # @!attribute full_name + # + # @return [String, nil] + optional :full_name, String, api_name: :fullName + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute place_type + # + # @return [String, nil] + optional :place_type, String, api_name: :placeType + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id: nil, bounding_box: nil, country: nil, country_code: nil, full_name: nil, name: nil, place_type: nil, url: nil) + # Public place metadata attached to a tweet. + # + # @param id [String] + # @param bounding_box [Hash{Symbol=>Object}] + # @param country [String] + # @param country_code [String] + # @param full_name [String] + # @param name [String] + # @param place_type [String] + # @param url [String] + end + + # @see XTwitterScraper::Models::EmbeddedTweet#previous_counts + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + # @!attribute bookmark_count + # + # @return [Integer, nil] + optional :bookmark_count, Integer, api_name: :bookmarkCount + + # @!attribute like_count + # + # @return [Integer, nil] + optional :like_count, Integer, api_name: :likeCount + + # @!attribute quote_count + # + # @return [Integer, nil] + optional :quote_count, Integer, api_name: :quoteCount + + # @!attribute reply_count + # + # @return [Integer, nil] + optional :reply_count, Integer, api_name: :replyCount + + # @!attribute retweet_count + # + # @return [Integer, nil] + optional :retweet_count, Integer, api_name: :retweetCount + + # @!method initialize(bookmark_count: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil) + # Engagement counts retained from a prior tweet edit. + # + # @param bookmark_count [Integer] + # @param like_count [Integer] + # @param quote_count [Integer] + # @param reply_count [Integer] + # @param retweet_count [Integer] + end end end end diff --git a/lib/x_twitter_scraper/models/paginated_tweets.rb b/lib/x_twitter_scraper/models/paginated_tweets.rb index fbdc0be..04134e1 100644 --- a/lib/x_twitter_scraper/models/paginated_tweets.rb +++ b/lib/x_twitter_scraper/models/paginated_tweets.rb @@ -23,11 +23,10 @@ class PaginatedTweets < XTwitterScraper::Internal::Type::BaseModel required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet] } # @!method initialize(has_next_page:, next_cursor:, tweets:) - # Paginated tweet results. The item count can be lower than pageSize when the - # source returns fewer tweets, filters remove tweets, or remaining credits cover - # fewer results. Follow next_cursor while has_next_page is true. An empty page can - # still have has_next_page true after filtering. Zero affordable results returns - # 402 insufficient_credits. + # Paginated tweets. Source visibility, filters, or remaining credits can reduce + # results. An empty filtered page can still have has_next_page true. Follow + # next_cursor while has_next_page is true. Zero affordable results returns 402 + # insufficient_credits. # # @param has_next_page [Boolean] # @param next_cursor [String] diff --git a/lib/x_twitter_scraper/models/search_tweet.rb b/lib/x_twitter_scraper/models/search_tweet.rb index eb71ab1..0899b80 100644 --- a/lib/x_twitter_scraper/models/search_tweet.rb +++ b/lib/x_twitter_scraper/models/search_tweet.rb @@ -47,12 +47,30 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Integer] required :view_count, Integer, api_name: :viewCount + # @!attribute article + # Article metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::SearchTweet::Article, nil] + optional :article, -> { XTwitterScraper::SearchTweet::Article } + # @!attribute author # X user profile with bio, follower counts, and verification status. # # @return [XTwitterScraper::Models::UserProfile, nil] optional :author, -> { XTwitterScraper::UserProfile } + # @!attribute card + # Public card metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::SearchTweet::Card, nil] + optional :card, -> { XTwitterScraper::SearchTweet::Card } + + # @!attribute community_note + # Community Note presentation metadata returned by X. + # + # @return [XTwitterScraper::Models::SearchTweet::CommunityNote, nil] + optional :community_note, -> { XTwitterScraper::SearchTweet::CommunityNote }, api_name: :communityNote + # @!attribute content_disclosure # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. @@ -79,6 +97,12 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel XTwitterScraper::Internal::Type::ArrayOf[Integer], api_name: :displayTextRange + # @!attribute edit + # Edit history metadata returned by X. + # + # @return [XTwitterScraper::Models::SearchTweet::Edit, nil] + optional :edit, -> { XTwitterScraper::SearchTweet::Edit } + # @!attribute entities # Parsed search-result entities including URLs, mentions, hashtags, and media # markers @@ -128,6 +152,11 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply + # @!attribute is_translatable + # + # @return [Boolean, nil] + optional :is_translatable, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslatable + # @!attribute lang # Search result language code. # @@ -140,6 +169,33 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @return [Array, nil] optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] } + # @!attribute note_tweet + # Complete Note Tweet content and rich-text metadata. + # + # @return [XTwitterScraper::Models::SearchTweet::NoteTweet, nil] + optional :note_tweet, -> { XTwitterScraper::SearchTweet::NoteTweet }, api_name: :noteTweet + + # @!attribute place + # Public place metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::SearchTweet::Place, nil] + optional :place, -> { XTwitterScraper::SearchTweet::Place } + + # @!attribute possibly_sensitive + # + # @return [Boolean, nil] + optional :possibly_sensitive, XTwitterScraper::Internal::Type::Boolean, api_name: :possiblySensitive + + # @!attribute previous_counts + # Engagement counts retained from a prior tweet edit. + # + # @return [XTwitterScraper::Models::SearchTweet::PreviousCounts, nil] + optional :previous_counts, + -> { + XTwitterScraper::SearchTweet::PreviousCounts + }, + api_name: :previousCounts + # @!attribute quoted_tweet # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, @@ -173,7 +229,12 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :url, String - # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, author: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, lang: nil, media: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil) + # @!attribute view_state + # + # @return [String, nil] + optional :view_state, String, api_name: :viewState + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, article: nil, author: nil, card: nil, community_note: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, edit: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, is_translatable: nil, lang: nil, media: nil, note_tweet: nil, place: nil, possibly_sensitive: nil, previous_counts: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil, view_state: nil) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::SearchTweet} for more details. # @@ -196,8 +257,14 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param view_count [Integer] # + # @param article [XTwitterScraper::Models::SearchTweet::Article] Article metadata attached to a tweet. + # # @param author [XTwitterScraper::Models::UserProfile] X user profile with bio, follower counts, and verification status. # + # @param card [XTwitterScraper::Models::SearchTweet::Card] Public card metadata attached to a tweet. + # + # @param community_note [XTwitterScraper::Models::SearchTweet::CommunityNote] Community Note presentation metadata returned by X. + # # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh # # @param conversation_id [String] Root tweet ID for the search result conversation @@ -206,6 +273,8 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param display_text_range [Array] Rendered text's start and end offsets. # + # @param edit [XTwitterScraper::Models::SearchTweet::Edit] Edit history metadata returned by X. + # # @param entities [Hash{Symbol=>Object}] Parsed search-result entities including URLs, mentions, hashtags, and media mark # # @param in_reply_to_id [String] ID of the tweet this result replies to. @@ -222,10 +291,20 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # # @param is_reply [Boolean] True when this search result is a reply # + # @param is_translatable [Boolean] + # # @param lang [String] Search result language code. # # @param media [Array] Search-result media attachments, omitted when no media is present # + # @param note_tweet [XTwitterScraper::Models::SearchTweet::NoteTweet] Complete Note Tweet content and rich-text metadata. + # + # @param place [XTwitterScraper::Models::SearchTweet::Place] Public place metadata attached to a tweet. + # + # @param possibly_sensitive [Boolean] + # + # @param previous_counts [XTwitterScraper::Models::SearchTweet::PreviousCounts] Engagement counts retained from a prior tweet edit. + # # @param quoted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen # # @param retweeted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen @@ -235,6 +314,297 @@ class SearchTweet < XTwitterScraper::Internal::Type::BaseModel # @param type [String] # # @param url [String] Search result permalink. + # + # @param view_state [String] + + # @see XTwitterScraper::Models::SearchTweet#article + class Article < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute cover_media_url + # + # @return [String, nil] + optional :cover_media_url, String, api_name: :coverMediaUrl + + # @!attribute preview_text + # + # @return [String, nil] + optional :preview_text, String, api_name: :previewText + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!method initialize(id: nil, cover_media_url: nil, preview_text: nil, title: nil) + # Article metadata attached to a tweet. + # + # @param id [String] + # @param cover_media_url [String] + # @param preview_text [String] + # @param title [String] + end + + # @see XTwitterScraper::Models::SearchTweet#card + class Card < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute binding_values + # + # @return [Hash{Symbol=>Object}, nil] + optional :binding_values, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + api_name: :bindingValues + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id: nil, binding_values: nil, name: nil, url: nil) + # Public card metadata attached to a tweet. + # + # @param id [String] + # @param binding_values [Hash{Symbol=>Object}] + # @param name [String] + # @param url [String] + end + + # @see XTwitterScraper::Models::SearchTweet#community_note + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute destination_url + # + # @return [String, nil] + optional :destination_url, String, api_name: :destinationUrl + + # @!attribute footer + # + # @return [String, nil] + optional :footer, String + + # @!attribute short_title + # + # @return [String, nil] + optional :short_title, String, api_name: :shortTitle + + # @!attribute subtitle + # + # @return [String, nil] + optional :subtitle, String + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!attribute visual_style + # + # @return [String, nil] + optional :visual_style, String, api_name: :visualStyle + + # @!method initialize(id: nil, destination_url: nil, footer: nil, short_title: nil, subtitle: nil, title: nil, visual_style: nil) + # Community Note presentation metadata returned by X. + # + # @param id [String] + # @param destination_url [String] + # @param footer [String] + # @param short_title [String] + # @param subtitle [String] + # @param title [String] + # @param visual_style [String] + end + + # @see XTwitterScraper::Models::SearchTweet#edit + class Edit < XTwitterScraper::Internal::Type::BaseModel + # @!attribute editable_until_msecs + # + # @return [String, nil] + optional :editable_until_msecs, String, api_name: :editableUntilMsecs + + # @!attribute edit_tweet_ids + # + # @return [Array, nil] + optional :edit_tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :editTweetIds + + # @!method initialize(editable_until_msecs: nil, edit_tweet_ids: nil) + # Edit history metadata returned by X. + # + # @param editable_until_msecs [String] + # @param edit_tweet_ids [Array] + end + + # @see XTwitterScraper::Models::SearchTweet#note_tweet + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + # @!attribute text + # + # @return [String] + required :text, String + + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute entities + # + # @return [Hash{Symbol=>Object}, nil] + optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute is_expandable + # + # @return [Boolean, nil] + optional :is_expandable, XTwitterScraper::Internal::Type::Boolean, api_name: :isExpandable + + # @!attribute richtext_tags + # + # @return [Array, nil] + optional :richtext_tags, + -> { + XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + }, + api_name: :richtextTags + + # @!method initialize(text:, id: nil, entities: nil, is_expandable: nil, richtext_tags: nil) + # Complete Note Tweet content and rich-text metadata. + # + # @param text [String] + # @param id [String] + # @param entities [Hash{Symbol=>Object}] + # @param is_expandable [Boolean] + # @param richtext_tags [Array] + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + # @!attribute from_index + # + # @return [Integer] + required :from_index, Integer, api_name: :fromIndex + + # @!attribute to_index + # + # @return [Integer] + required :to_index, Integer, api_name: :toIndex + + # @!attribute types + # + # @return [Array] + required :types, XTwitterScraper::Internal::Type::ArrayOf[String] + + # @!method initialize(from_index:, to_index:, types:) + # @param from_index [Integer] + # @param to_index [Integer] + # @param types [Array] + end + end + + # @see XTwitterScraper::Models::SearchTweet#place + class Place < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute bounding_box + # + # @return [Hash{Symbol=>Object}, nil] + optional :bounding_box, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + api_name: :boundingBox + + # @!attribute country + # + # @return [String, nil] + optional :country, String + + # @!attribute country_code + # + # @return [String, nil] + optional :country_code, String, api_name: :countryCode + + # @!attribute full_name + # + # @return [String, nil] + optional :full_name, String, api_name: :fullName + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute place_type + # + # @return [String, nil] + optional :place_type, String, api_name: :placeType + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id: nil, bounding_box: nil, country: nil, country_code: nil, full_name: nil, name: nil, place_type: nil, url: nil) + # Public place metadata attached to a tweet. + # + # @param id [String] + # @param bounding_box [Hash{Symbol=>Object}] + # @param country [String] + # @param country_code [String] + # @param full_name [String] + # @param name [String] + # @param place_type [String] + # @param url [String] + end + + # @see XTwitterScraper::Models::SearchTweet#previous_counts + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + # @!attribute bookmark_count + # + # @return [Integer, nil] + optional :bookmark_count, Integer, api_name: :bookmarkCount + + # @!attribute like_count + # + # @return [Integer, nil] + optional :like_count, Integer, api_name: :likeCount + + # @!attribute quote_count + # + # @return [Integer, nil] + optional :quote_count, Integer, api_name: :quoteCount + + # @!attribute reply_count + # + # @return [Integer, nil] + optional :reply_count, Integer, api_name: :replyCount + + # @!attribute retweet_count + # + # @return [Integer, nil] + optional :retweet_count, Integer, api_name: :retweetCount + + # @!method initialize(bookmark_count: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil) + # Engagement counts retained from a prior tweet edit. + # + # @param bookmark_count [Integer] + # @param like_count [Integer] + # @param quote_count [Integer] + # @param reply_count [Integer] + # @param retweet_count [Integer] + end end end end diff --git a/lib/x_twitter_scraper/models/support/ticket_list_response.rb b/lib/x_twitter_scraper/models/support/ticket_list_response.rb index f8ab564..d16bbf7 100644 --- a/lib/x_twitter_scraper/models/support/ticket_list_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_list_response.rb @@ -11,51 +11,64 @@ module Support class TicketListResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute tickets # - # @return [Array, nil] - optional :tickets, + # @return [Array] + required :tickets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketListResponse::Ticket] } - # @!method initialize(tickets: nil) + # @!method initialize(tickets:) # @param tickets [Array] class Ticket < XTwitterScraper::Internal::Type::BaseModel # @!attribute created_at # - # @return [Time, nil] - optional :created_at, Time, api_name: :createdAt + # @return [Time] + required :created_at, Time, api_name: :createdAt # @!attribute message_count # - # @return [Integer, nil] - optional :message_count, Integer, api_name: :messageCount + # @return [Integer] + required :message_count, Integer, api_name: :messageCount # @!attribute public_id # - # @return [String, nil] - optional :public_id, String, api_name: :publicId + # @return [String] + required :public_id, String, api_name: :publicId # @!attribute status # - # @return [String, nil] - optional :status, String + # @return [Symbol, XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status] + required :status, enum: -> { XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status } # @!attribute subject # - # @return [String, nil] - optional :subject, String + # @return [String] + required :subject, String # @!attribute updated_at # - # @return [Time, nil] - optional :updated_at, Time, api_name: :updatedAt + # @return [Time] + required :updated_at, Time, api_name: :updatedAt - # @!method initialize(created_at: nil, message_count: nil, public_id: nil, status: nil, subject: nil, updated_at: nil) + # @!method initialize(created_at:, message_count:, public_id:, status:, subject:, updated_at:) # @param created_at [Time] # @param message_count [Integer] # @param public_id [String] - # @param status [String] + # @param status [Symbol, XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status] # @param subject [String] # @param updated_at [Time] + + # @see XTwitterScraper::Models::Support::TicketListResponse::Ticket#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + OPEN = :open + IN_PROGRESS = :in_progress + RESOLVED = :resolved + CLOSED = :closed + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb b/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb index 26cb73f..dc3dadf 100644 --- a/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb @@ -11,70 +11,70 @@ module Support class TicketRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute created_at # - # @return [Time, nil] - optional :created_at, Time, api_name: :createdAt + # @return [Time] + required :created_at, Time, api_name: :createdAt # @!attribute messages # - # @return [Array, nil] - optional :messages, + # @return [Array] + required :messages, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message] } # @!attribute public_id # - # @return [String, nil] - optional :public_id, String, api_name: :publicId + # @return [String] + required :public_id, String, api_name: :publicId # @!attribute status # - # @return [String, nil] - optional :status, String + # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::Support::TicketRetrieveResponse::Status } # @!attribute subject # - # @return [String, nil] - optional :subject, String + # @return [String] + required :subject, String # @!attribute updated_at # - # @return [Time, nil] - optional :updated_at, Time, api_name: :updatedAt + # @return [Time] + required :updated_at, Time, api_name: :updatedAt - # @!method initialize(created_at: nil, messages: nil, public_id: nil, status: nil, subject: nil, updated_at: nil) + # @!method initialize(created_at:, messages:, public_id:, status:, subject:, updated_at:) # @param created_at [Time] # @param messages [Array] # @param public_id [String] - # @param status [String] + # @param status [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Status] # @param subject [String] # @param updated_at [Time] class Message < XTwitterScraper::Internal::Type::BaseModel # @!attribute attachments # - # @return [Array, nil] - optional :attachments, + # @return [Array] + required :attachments, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] } # @!attribute body # - # @return [String, nil] - optional :body, String + # @return [String] + required :body, String # @!attribute created_at # - # @return [Time, nil] - optional :created_at, Time, api_name: :createdAt + # @return [Time] + required :created_at, Time, api_name: :createdAt # @!attribute sender # - # @return [String, nil] - optional :sender, String + # @return [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender] + required :sender, enum: -> { XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender } - # @!method initialize(attachments: nil, body: nil, created_at: nil, sender: nil) + # @!method initialize(attachments:, body:, created_at:, sender:) # @param attachments [Array] # @param body [String] # @param created_at [Time] - # @param sender [String] + # @param sender [Symbol, XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender] class Attachment < XTwitterScraper::Internal::Type::BaseModel # @!attribute content_type @@ -181,6 +181,31 @@ module Status # @return [Array] end end + + # @see XTwitterScraper::Models::Support::TicketRetrieveResponse::Message#sender + module Sender + extend XTwitterScraper::Internal::Type::Enum + + USER = :user + SUPPORT = :support + SYSTEM = :system + + # @!method self.values + # @return [Array] + end + end + + # @see XTwitterScraper::Models::Support::TicketRetrieveResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + OPEN = :open + IN_PROGRESS = :in_progress + RESOLVED = :resolved + CLOSED = :closed + + # @!method self.values + # @return [Array] end end end diff --git a/lib/x_twitter_scraper/models/support/ticket_update_response.rb b/lib/x_twitter_scraper/models/support/ticket_update_response.rb index a0e89b3..bca2dd0 100644 --- a/lib/x_twitter_scraper/models/support/ticket_update_response.rb +++ b/lib/x_twitter_scraper/models/support/ticket_update_response.rb @@ -11,17 +11,29 @@ module Support class TicketUpdateResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute public_id # - # @return [String, nil] - optional :public_id, String, api_name: :publicId + # @return [String] + required :public_id, String, api_name: :publicId # @!attribute status # - # @return [String, nil] - optional :status, String + # @return [Symbol, XTwitterScraper::Models::Support::TicketUpdateResponse::Status] + required :status, enum: -> { XTwitterScraper::Models::Support::TicketUpdateResponse::Status } - # @!method initialize(public_id: nil, status: nil) + # @!method initialize(public_id:, status:) # @param public_id [String] - # @param status [String] + # @param status [Symbol, XTwitterScraper::Models::Support::TicketUpdateResponse::Status] + + # @see XTwitterScraper::Models::Support::TicketUpdateResponse#status + module Status + extend XTwitterScraper::Internal::Type::Enum + + OPEN = :open + RESOLVED = :resolved + CLOSED = :closed + + # @!method self.values + # @return [Array] + end end end end diff --git a/lib/x_twitter_scraper/models/trend_list_response.rb b/lib/x_twitter_scraper/models/trend_list_response.rb index 8135b59..527cfce 100644 --- a/lib/x_twitter_scraper/models/trend_list_response.rb +++ b/lib/x_twitter_scraper/models/trend_list_response.rb @@ -40,6 +40,12 @@ class Trend < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :description, String + # @!attribute promoted_content + # Promotion identifier from X. Null for organic trends. + # + # @return [String, nil] + optional :promoted_content, String, api_name: :promotedContent, nil?: true + # @!attribute query # # @return [String, nil] @@ -50,11 +56,32 @@ class Trend < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :rank, Integer - # @!method initialize(name:, description: nil, query: nil, rank: nil) + # @!attribute tweet_volume + # Approximate public post volume when X supplies it. + # + # @return [Integer, nil] + optional :tweet_volume, Integer, api_name: :tweetVolume, nil?: true + + # @!attribute url + # X search URL for the trend. + # + # @return [String, nil] + optional :url, String + + # @!method initialize(name:, description: nil, promoted_content: nil, query: nil, rank: nil, tweet_volume: nil, url: nil) # @param name [String] + # # @param description [String] + # + # @param promoted_content [String, nil] Promotion identifier from X. Null for organic trends. + # # @param query [String] + # # @param rank [Integer] + # + # @param tweet_volume [Integer, nil] Approximate public post volume when X supplies it. + # + # @param url [String] X search URL for the trend. end end end diff --git a/lib/x_twitter_scraper/models/tweet_media.rb b/lib/x_twitter_scraper/models/tweet_media.rb index de4f409..ba3e6cf 100644 --- a/lib/x_twitter_scraper/models/tweet_media.rb +++ b/lib/x_twitter_scraper/models/tweet_media.rb @@ -24,6 +24,102 @@ class TweetMedia < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :url, String + # @!attribute id + # X media entity ID. + # + # @return [String, nil] + optional :id, String + + # @!attribute allow_download + # Whether X permits direct media download. + # + # @return [Boolean, nil] + optional :allow_download, XTwitterScraper::Internal::Type::Boolean, api_name: :allowDownload + + # @!attribute alt_text + # Accessibility text supplied for the media. + # + # @return [String, nil] + optional :alt_text, String, api_name: :altText + + # @!attribute aspect_ratio + # Video aspect ratio as width and height. + # + # @return [Array, nil] + optional :aspect_ratio, XTwitterScraper::Internal::Type::ArrayOf[Integer], api_name: :aspectRatio + + # @!attribute availability_status + # Media availability state reported by X. + # + # @return [String, nil] + optional :availability_status, String, api_name: :availabilityStatus + + # @!attribute display_url + # Display-friendly media URL reported by X. + # + # @return [String, nil] + optional :display_url, String, api_name: :displayUrl + + # @!attribute duration_millis + # Video duration in milliseconds. + # + # @return [Integer, nil] + optional :duration_millis, Integer, api_name: :durationMillis + + # @!attribute expanded_url + # Expanded X media URL. + # + # @return [String, nil] + optional :expanded_url, String, api_name: :expandedUrl + + # @!attribute face_rects + # Face-aware crop rectangles grouped by media size. + # + # @return [Hash{Symbol=>Array}, nil] + optional :face_rects, + -> { + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia::FaceRect]] + }, + api_name: :faceRects + + # @!attribute focus_rects + # Suggested image crops reported by X. + # + # @return [Array, nil] + optional :focus_rects, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia::FocusRect] }, + api_name: :focusRects + + # @!attribute height + # Original media height. + # + # @return [Integer, nil] + optional :height, Integer + + # @!attribute indices + # Media entity offsets in the tweet text. + # + # @return [Array, nil] + optional :indices, XTwitterScraper::Internal::Type::ArrayOf[Integer] + + # @!attribute media_key + # Stable X media key. + # + # @return [String, nil] + optional :media_key, String, api_name: :mediaKey + + # @!attribute monetizable + # Whether X reports the media as monetizable. + # + # @return [Boolean, nil] + optional :monetizable, XTwitterScraper::Internal::Type::Boolean + + # @!attribute sizes + # Named media renditions and resize modes. + # + # @return [Hash{Symbol=>XTwitterScraper::Models::TweetMedia::Size}, nil] + optional :sizes, -> { XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::TweetMedia::Size] } + # @!attribute video_variants # Available video encodings, ordered as returned # @@ -32,7 +128,13 @@ class TweetMedia < XTwitterScraper::Internal::Type::BaseModel -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia::VideoVariant] }, api_name: :videoVariants - # @!method initialize(media_url:, type:, url:, video_variants: nil) + # @!attribute width + # Original media width. + # + # @return [Integer, nil] + optional :width, Integer + + # @!method initialize(media_url:, type:, url:, id: nil, allow_download: nil, alt_text: nil, aspect_ratio: nil, availability_status: nil, display_url: nil, duration_millis: nil, expanded_url: nil, face_rects: nil, focus_rects: nil, height: nil, indices: nil, media_key: nil, monetizable: nil, sizes: nil, video_variants: nil, width: nil) # Normalized media attached to a tweet. # # @param media_url [String] Media preview URL @@ -41,7 +143,39 @@ class TweetMedia < XTwitterScraper::Internal::Type::BaseModel # # @param url [String] X media link from the tweet # + # @param id [String] X media entity ID. + # + # @param allow_download [Boolean] Whether X permits direct media download. + # + # @param alt_text [String] Accessibility text supplied for the media. + # + # @param aspect_ratio [Array] Video aspect ratio as width and height. + # + # @param availability_status [String] Media availability state reported by X. + # + # @param display_url [String] Display-friendly media URL reported by X. + # + # @param duration_millis [Integer] Video duration in milliseconds. + # + # @param expanded_url [String] Expanded X media URL. + # + # @param face_rects [Hash{Symbol=>Array}] Face-aware crop rectangles grouped by media size. + # + # @param focus_rects [Array] Suggested image crops reported by X. + # + # @param height [Integer] Original media height. + # + # @param indices [Array] Media entity offsets in the tweet text. + # + # @param media_key [String] Stable X media key. + # + # @param monetizable [Boolean] Whether X reports the media as monetizable. + # + # @param sizes [Hash{Symbol=>XTwitterScraper::Models::TweetMedia::Size}] Named media renditions and resize modes. + # # @param video_variants [Array] Available video encodings, ordered as returned + # + # @param width [Integer] Original media width. # @see XTwitterScraper::Models::TweetMedia#type module Type @@ -55,6 +189,84 @@ module Type # @return [Array] end + class FaceRect < XTwitterScraper::Internal::Type::BaseModel + # @!attribute h + # + # @return [Integer] + required :h, Integer + + # @!attribute w + # + # @return [Integer] + required :w, Integer + + # @!attribute x + # + # @return [Integer] + required :x, Integer + + # @!attribute y_ + # + # @return [Integer] + required :y_, Integer, api_name: :y + + # @!method initialize(h:, w:, x:, y_:) + # @param h [Integer] + # @param w [Integer] + # @param x [Integer] + # @param y_ [Integer] + end + + class FocusRect < XTwitterScraper::Internal::Type::BaseModel + # @!attribute h + # + # @return [Integer] + required :h, Integer + + # @!attribute w + # + # @return [Integer] + required :w, Integer + + # @!attribute x + # + # @return [Integer] + required :x, Integer + + # @!attribute y_ + # + # @return [Integer] + required :y_, Integer, api_name: :y + + # @!method initialize(h:, w:, x:, y_:) + # @param h [Integer] + # @param w [Integer] + # @param x [Integer] + # @param y_ [Integer] + end + + class Size < XTwitterScraper::Internal::Type::BaseModel + # @!attribute h + # + # @return [Integer] + required :h, Integer + + # @!attribute resize + # + # @return [String] + required :resize, String + + # @!attribute w + # + # @return [Integer] + required :w, Integer + + # @!method initialize(h:, resize:, w:) + # @param h [Integer] + # @param resize [String] + # @param w [Integer] + end + class VideoVariant < XTwitterScraper::Internal::Type::BaseModel # @!attribute content_type # diff --git a/lib/x_twitter_scraper/models/user_profile.rb b/lib/x_twitter_scraper/models/user_profile.rb index 9a161dd..e5b51ca 100644 --- a/lib/x_twitter_scraper/models/user_profile.rb +++ b/lib/x_twitter_scraper/models/user_profile.rb @@ -22,15 +22,23 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :username, String + # @!attribute affiliates_highlighted_label + # Organization affiliation label shown on an X profile. + # + # @return [XTwitterScraper::Models::UserProfile::AffiliatesHighlightedLabel, nil] + optional :affiliates_highlighted_label, + -> { XTwitterScraper::UserProfile::AffiliatesHighlightedLabel }, + api_name: :affiliatesHighlightedLabel + # @!attribute automated_by # # @return [String, nil] optional :automated_by, String, api_name: :automatedBy - # @!attribute can_dm + # @!attribute business_account_affiliates_count # - # @return [Boolean, nil] - optional :can_dm, XTwitterScraper::Internal::Type::Boolean, api_name: :canDm + # @return [Integer, nil] + optional :business_account_affiliates_count, Integer, api_name: :businessAccountAffiliatesCount # @!attribute community_role # Community role when returned by community member reads @@ -48,6 +56,11 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :created_at, String, api_name: :createdAt + # @!attribute creator_subscriptions_count + # + # @return [Integer, nil] + optional :creator_subscriptions_count, Integer, api_name: :creatorSubscriptionsCount + # @!attribute description # # @return [String, nil] @@ -73,6 +86,36 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :has_custom_timelines, XTwitterScraper::Internal::Type::Boolean, api_name: :hasCustomTimelines + # @!attribute has_graduated_access + # + # @return [Boolean, nil] + optional :has_graduated_access, XTwitterScraper::Internal::Type::Boolean, api_name: :hasGraduatedAccess + + # @!attribute has_hidden_subscriptions_on_profile + # + # @return [Boolean, nil] + optional :has_hidden_subscriptions_on_profile, + XTwitterScraper::Internal::Type::Boolean, + api_name: :hasHiddenSubscriptionsOnProfile + + # @!attribute highlights_info + # Profile highlight availability and count metadata. + # + # @return [XTwitterScraper::Models::UserProfile::HighlightsInfo, nil] + optional :highlights_info, + -> { + XTwitterScraper::UserProfile::HighlightsInfo + }, + api_name: :highlightsInfo + + # @!attribute identity_verification + # Identity verification metadata displayed by X. + # + # @return [XTwitterScraper::Models::UserProfile::IdentityVerification, nil] + optional :identity_verification, + -> { XTwitterScraper::UserProfile::IdentityVerification }, + api_name: :identityVerification + # @!attribute is_automated # # @return [Boolean, nil] @@ -84,6 +127,13 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :is_blue_verified, XTwitterScraper::Internal::Type::Boolean, api_name: :isBlueVerified + # @!attribute is_profile_translatable + # + # @return [Boolean, nil] + optional :is_profile_translatable, + XTwitterScraper::Internal::Type::Boolean, + api_name: :isProfileTranslatable + # @!attribute is_translator # # @return [Boolean, nil] @@ -105,6 +155,11 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :media_count, Integer, api_name: :mediaCount + # @!attribute parody_commentary_fan_label + # + # @return [String, nil] + optional :parody_commentary_fan_label, String, api_name: :parodyCommentaryFanLabel + # @!attribute pinned_tweet_ids # # @return [Array, nil] @@ -127,11 +182,36 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :profile_banner_url, String, api_name: :profileBannerUrl + # @!attribute profile_description_language + # + # @return [String, nil] + optional :profile_description_language, String, api_name: :profileDescriptionLanguage + + # @!attribute profile_image_shape + # + # @return [String, nil] + optional :profile_image_shape, String, api_name: :profileImageShape + + # @!attribute profile_interstitial_type + # + # @return [String, nil] + optional :profile_interstitial_type, String, api_name: :profileInterstitialType + # @!attribute profile_picture # # @return [String, nil] optional :profile_picture, String, api_name: :profilePicture + # @!attribute profile_sort_enabled + # + # @return [Boolean, nil] + optional :profile_sort_enabled, XTwitterScraper::Internal::Type::Boolean, api_name: :profileSortEnabled + + # @!attribute profile_translator_type + # + # @return [String, nil] + optional :profile_translator_type, String, api_name: :profileTranslatorType + # @!attribute protected # Whether the profile protects its posts # @@ -143,6 +223,13 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :statuses_count, Integer, api_name: :statusesCount + # @!attribute super_follow_eligible + # + # @return [Boolean, nil] + optional :super_follow_eligible, + XTwitterScraper::Internal::Type::Boolean, + api_name: :superFollowEligible + # @!attribute unavailable # # @return [Boolean, nil] @@ -168,18 +255,6 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :verified_type, String, api_name: :verifiedType - # @!attribute viewer_followed_by - # Whether this profile follows the authenticated viewer - # - # @return [Boolean, nil] - optional :viewer_followed_by, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowedBy - - # @!attribute viewer_following - # Whether the authenticated viewer follows this profile - # - # @return [Boolean, nil] - optional :viewer_following, XTwitterScraper::Internal::Type::Boolean, api_name: :viewerFollowing - # @!attribute withheld_in_countries # # @return [Array, nil] @@ -187,7 +262,7 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :withheldInCountries - # @!method initialize(id:, name:, username:, automated_by: nil, can_dm: nil, community_role: nil, cover_picture: nil, created_at: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, is_automated: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, profile_bio: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, viewer_followed_by: nil, viewer_following: nil, withheld_in_countries: nil) + # @!method initialize(id:, name:, username:, affiliates_highlighted_label: nil, automated_by: nil, business_account_affiliates_count: nil, community_role: nil, cover_picture: nil, created_at: nil, creator_subscriptions_count: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, has_graduated_access: nil, has_hidden_subscriptions_on_profile: nil, highlights_info: nil, identity_verification: nil, is_automated: nil, is_blue_verified: nil, is_profile_translatable: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, parody_commentary_fan_label: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, profile_bio: nil, profile_banner_url: nil, profile_description_language: nil, profile_image_shape: nil, profile_interstitial_type: nil, profile_picture: nil, profile_sort_enabled: nil, profile_translator_type: nil, protected: nil, statuses_count: nil, super_follow_eligible: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, withheld_in_countries: nil) # X user profile with bio, follower counts, and verification status. # # @param id [String] @@ -196,9 +271,11 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # # @param username [String] # + # @param affiliates_highlighted_label [XTwitterScraper::Models::UserProfile::AffiliatesHighlightedLabel] Organization affiliation label shown on an X profile. + # # @param automated_by [String] # - # @param can_dm [Boolean] + # @param business_account_affiliates_count [Integer] # # @param community_role [String] Community role when returned by community member reads # @@ -206,6 +283,8 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # # @param created_at [String] # + # @param creator_subscriptions_count [Integer] + # # @param description [String] # # @param favourites_count [Integer] @@ -216,10 +295,20 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # # @param has_custom_timelines [Boolean] # + # @param has_graduated_access [Boolean] + # + # @param has_hidden_subscriptions_on_profile [Boolean] + # + # @param highlights_info [XTwitterScraper::Models::UserProfile::HighlightsInfo] Profile highlight availability and count metadata. + # + # @param identity_verification [XTwitterScraper::Models::UserProfile::IdentityVerification] Identity verification metadata displayed by X. + # # @param is_automated [Boolean] # # @param is_blue_verified [Boolean] Whether X shows a blue verification badge # + # @param is_profile_translatable [Boolean] + # # @param is_translator [Boolean] # # @param is_verified [Boolean] Whether X marks the profile as verified @@ -228,6 +317,8 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # # @param media_count [Integer] # + # @param parody_commentary_fan_label [String] + # # @param pinned_tweet_ids [Array] # # @param possibly_sensitive [Boolean] @@ -236,12 +327,24 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # # @param profile_banner_url [String] Original X profile banner field when available # + # @param profile_description_language [String] + # + # @param profile_image_shape [String] + # + # @param profile_interstitial_type [String] + # # @param profile_picture [String] # + # @param profile_sort_enabled [Boolean] + # + # @param profile_translator_type [String] + # # @param protected [Boolean] Whether the profile protects its posts # # @param statuses_count [Integer] # + # @param super_follow_eligible [Boolean] + # # @param unavailable [Boolean] # # @param unavailable_reason [String] @@ -252,11 +355,98 @@ class UserProfile < XTwitterScraper::Internal::Type::BaseModel # # @param verified_type [String] # - # @param viewer_followed_by [Boolean] Whether this profile follows the authenticated viewer - # - # @param viewer_following [Boolean] Whether the authenticated viewer follows this profile - # # @param withheld_in_countries [Array] + + # @see XTwitterScraper::Models::UserProfile#affiliates_highlighted_label + class AffiliatesHighlightedLabel < XTwitterScraper::Internal::Type::BaseModel + # @!attribute badge_url + # + # @return [String, nil] + optional :badge_url, String, api_name: :badgeUrl + + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!attribute url_type + # + # @return [String, nil] + optional :url_type, String, api_name: :urlType + + # @!attribute user_label_display_type + # + # @return [String, nil] + optional :user_label_display_type, String, api_name: :userLabelDisplayType + + # @!attribute user_label_type + # + # @return [String, nil] + optional :user_label_type, String, api_name: :userLabelType + + # @!method initialize(badge_url: nil, description: nil, url: nil, url_type: nil, user_label_display_type: nil, user_label_type: nil) + # Organization affiliation label shown on an X profile. + # + # @param badge_url [String] + # @param description [String] + # @param url [String] + # @param url_type [String] + # @param user_label_display_type [String] + # @param user_label_type [String] + end + + # @see XTwitterScraper::Models::UserProfile#highlights_info + class HighlightsInfo < XTwitterScraper::Internal::Type::BaseModel + # @!attribute can_highlight_tweets + # + # @return [Boolean, nil] + optional :can_highlight_tweets, + XTwitterScraper::Internal::Type::Boolean, + api_name: :canHighlightTweets + + # @!attribute highlighted_tweets + # + # @return [String, nil] + optional :highlighted_tweets, String, api_name: :highlightedTweets + + # @!method initialize(can_highlight_tweets: nil, highlighted_tweets: nil) + # Profile highlight availability and count metadata. + # + # @param can_highlight_tweets [Boolean] + # @param highlighted_tweets [String] + end + + # @see XTwitterScraper::Models::UserProfile#identity_verification + class IdentityVerification < XTwitterScraper::Internal::Type::BaseModel + # @!attribute description + # + # @return [String, nil] + optional :description, String + + # @!attribute is_identity_verified + # + # @return [Boolean, nil] + optional :is_identity_verified, + XTwitterScraper::Internal::Type::Boolean, + api_name: :isIdentityVerified + + # @!attribute verified_since_msec + # + # @return [String, nil] + optional :verified_since_msec, String, api_name: :verifiedSinceMsec + + # @!method initialize(description: nil, is_identity_verified: nil, verified_since_msec: nil) + # Identity verification metadata displayed by X. + # + # @param description [String] + # @param is_identity_verified [Boolean] + # @param verified_since_msec [String] + end end end end diff --git a/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb b/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb index 41abdc1..f6e5ee7 100644 --- a/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb @@ -9,19 +9,22 @@ module X module AccountConnectionAttemptRetrieveResponse extend XTwitterScraper::Internal::Type::Union + discriminator :status + # The connection is still in progress. - variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending } + variant :pending, -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending } # The account connected successfully. - variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess } + variant :success, -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success } # The connection reached a final failure. - variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed } + variant :failed, -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed } # Resumable account connection challenge. Submit the email code to finish the same connection attempt. - variant -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge } + variant :requires_email_code, + -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode } - class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel + class Pending < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -51,7 +54,7 @@ class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseMo # @param status [Symbol, :pending] end - class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseModel + class Success < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -75,7 +78,7 @@ class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseMo # @param status [Symbol, :success] end - class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseModel + class Failed < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -117,7 +120,7 @@ class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseMod # @param status [Symbol, :failed] end - class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel + class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel # @!attribute id # # @return [String] @@ -135,55 +138,33 @@ class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel # @!attribute object # - # @return [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object] - required :object, - enum: -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object } + # @return [Symbol, :x_account_connection_challenge] + required :object, const: :x_account_connection_challenge # @!attribute status # - # @return [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status] - required :status, - enum: -> { XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status } + # @return [Symbol, :requires_email_code] + required :status, const: :requires_email_code # @!attribute username # # @return [String] required :username, String - # @!method initialize(id:, expires_at:, message:, object:, status:, username:) + # @!method initialize(id:, expires_at:, message:, username:, object: :x_account_connection_challenge, status: :requires_email_code) # Resumable account connection challenge. Submit the email code to finish the same # connection attempt. # # @param id [String] # @param expires_at [Time] # @param message [String] - # @param object [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object] - # @param status [Symbol, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status] # @param username [String] - - # @see XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge#object - module Object - extend XTwitterScraper::Internal::Type::Enum - - X_ACCOUNT_CONNECTION_CHALLENGE = :x_account_connection_challenge - - # @!method self.values - # @return [Array] - end - - # @see XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge#status - module Status - extend XTwitterScraper::Internal::Type::Enum - - REQUIRES_EMAIL_CODE = :requires_email_code - - # @!method self.values - # @return [Array] - end + # @param object [Symbol, :x_account_connection_challenge] + # @param status [Symbol, :requires_email_code] end # @!method self.variants - # @return [Array(XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge)] + # @return [Array(XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode)] end end end diff --git a/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb b/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb index 49fa299..a8b5cd1 100644 --- a/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +++ b/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb @@ -27,8 +27,8 @@ class AccountConnectionChallengeSubmitResponse < XTwitterScraper::Internal::Type # @!attribute status # - # @return [String] - required :status, String + # @return [Symbol, :active] + required :status, const: :active # @!attribute x_user_id # @@ -40,15 +40,15 @@ class AccountConnectionChallengeSubmitResponse < XTwitterScraper::Internal::Type # @return [String] required :x_username, String, api_name: :xUsername - # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:) + # @!method initialize(id:, created_at:, health:, x_user_id:, x_username:, status: :active) # Sanitized X account summary returned by connect and reauth. # # @param id [String] # @param created_at [Time] # @param health [Symbol, XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health] - # @param status [String] # @param x_user_id [String] # @param x_username [String] + # @param status [Symbol, :active] # @see XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse#health module Health diff --git a/lib/x_twitter_scraper/models/x/account_create_response.rb b/lib/x_twitter_scraper/models/x/account_create_response.rb index 59c0108..4c8095e 100644 --- a/lib/x_twitter_scraper/models/x/account_create_response.rb +++ b/lib/x_twitter_scraper/models/x/account_create_response.rb @@ -7,8 +7,155 @@ module XTwitterScraper module Models module X - # @type [XTwitterScraper::Internal::Type::Converter] - AccountCreateResponse = XTwitterScraper::Internal::Type::Unknown + # Sanitized X account summary returned by connect and reauth. + # + # @see XTwitterScraper::Resources::X::Accounts#create + module AccountCreateResponse + extend XTwitterScraper::Internal::Type::Union + + # Sanitized X account summary returned by connect and reauth. + variant -> { XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount } + + # The connection is still in progress. + variant -> { XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending } + + # Resumable account connection challenge. Submit the email code to finish the same connection attempt. + variant -> { XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge } + + class SanitizedXAccount < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Time] + required :created_at, Time, api_name: :createdAt + + # @!attribute health + # + # @return [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health] + required :health, + enum: -> { XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health } + + # @!attribute status + # + # @return [Symbol, :active] + required :status, const: :active + + # @!attribute x_user_id + # + # @return [String] + required :x_user_id, String, api_name: :xUserId + + # @!attribute x_username + # + # @return [String] + required :x_username, String, api_name: :xUsername + + # @!method initialize(id:, created_at:, health:, x_user_id:, x_username:, status: :active) + # Sanitized X account summary returned by connect and reauth. + # + # @param id [String] + # @param created_at [Time] + # @param health [Symbol, XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health] + # @param x_user_id [String] + # @param x_username [String] + # @param status [Symbol, :active] + + # @see XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount#health + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY = :healthy + LOCKED = :locked + NEEDS_REAUTH = :needsReauth + RECOVERING = :recovering + SUSPENDED = :suspended + TEMPORARY_ISSUE = :temporaryIssue + + # @!method self.values + # @return [Array] + end + end + + class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute object + # + # @return [Symbol, :x_account_connection_attempt] + required :object, const: :x_account_connection_attempt + + # @!attribute poll_after_ms + # + # @return [Integer] + required :poll_after_ms, Integer, api_name: :pollAfterMs + + # @!attribute status + # + # @return [Symbol, :pending] + required :status, const: :pending + + # @!method initialize(id:, poll_after_ms:, object: :x_account_connection_attempt, status: :pending) + # The connection is still in progress. + # + # @param id [String] + # @param poll_after_ms [Integer] + # @param object [Symbol, :x_account_connection_attempt] + # @param status [Symbol, :pending] + end + + class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute expires_at + # + # @return [Time] + required :expires_at, Time, api_name: :expiresAt + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute object + # + # @return [Symbol, :x_account_connection_challenge] + required :object, const: :x_account_connection_challenge + + # @!attribute status + # + # @return [Symbol, :requires_email_code] + required :status, const: :requires_email_code + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(id:, expires_at:, message:, username:, object: :x_account_connection_challenge, status: :requires_email_code) + # Resumable account connection challenge. Submit the email code to finish the same + # connection attempt. + # + # @param id [String] + # @param expires_at [Time] + # @param message [String] + # @param username [String] + # @param object [Symbol, :x_account_connection_challenge] + # @param status [Symbol, :requires_email_code] + end + + # @!method self.variants + # @return [Array(XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount, XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending, XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge)] + end end end end diff --git a/lib/x_twitter_scraper/models/x/account_reauth_response.rb b/lib/x_twitter_scraper/models/x/account_reauth_response.rb index d5225d3..3d84a31 100644 --- a/lib/x_twitter_scraper/models/x/account_reauth_response.rb +++ b/lib/x_twitter_scraper/models/x/account_reauth_response.rb @@ -26,8 +26,8 @@ class AccountReauthResponse < XTwitterScraper::Internal::Type::BaseModel # @!attribute status # - # @return [String] - required :status, String + # @return [Symbol, :active] + required :status, const: :active # @!attribute x_user_id # @@ -39,15 +39,15 @@ class AccountReauthResponse < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :x_username, String, api_name: :xUsername - # @!method initialize(id:, created_at:, health:, status:, x_user_id:, x_username:) + # @!method initialize(id:, created_at:, health:, x_user_id:, x_username:, status: :active) # Sanitized X account summary returned by connect and reauth. # # @param id [String] # @param created_at [Time] # @param health [Symbol, XTwitterScraper::Models::X::AccountReauthResponse::Health] - # @param status [String] # @param x_user_id [String] # @param x_username [String] + # @param status [Symbol, :active] # @see XTwitterScraper::Models::X::AccountReauthResponse#health module Health diff --git a/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb b/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb index 192b170..1c12fde 100644 --- a/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb +++ b/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb @@ -25,10 +25,8 @@ class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -43,7 +41,7 @@ class TweetListByCommunityParams < XTwitterScraper::Internal::Type::BaseModel # # @param cursor [String] Pagination cursor for community tweets # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end diff --git a/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb b/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb index a161123..36d9bc6 100644 --- a/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +++ b/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb @@ -32,10 +32,8 @@ class TweetListParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -57,7 +55,7 @@ class TweetListParams < XTwitterScraper::Internal::Type::BaseModel # # @param cursor [String] Pagination cursor for community results # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param query_type [Symbol, XTwitterScraper::Models::X::Communities::TweetListParams::QueryType] Sort order for community results (Latest or Top) # diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb b/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb index 3b3a49d..38ddceb 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb @@ -55,12 +55,6 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :invites_policy, String - # @!attribute is_member - # Whether the authenticated viewer is a member - # - # @return [Boolean, nil] - optional :is_member, XTwitterScraper::Internal::Type::Boolean - # @!attribute is_nsfw # Whether the community is marked sensitive # @@ -98,12 +92,6 @@ class Community < XTwitterScraper::Internal::Type::BaseModel optional :primary_topic, -> { XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic } - # @!attribute role - # Authenticated viewer's community role - # - # @return [String, nil] - optional :role, String - # @!attribute rules # Community rules # @@ -111,7 +99,7 @@ class Community < XTwitterScraper::Internal::Type::BaseModel optional :rules, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } - # @!method initialize(id:, banner_url: nil, created_at: nil, creator: nil, description: nil, invites_policy: nil, is_member: nil, is_nsfw: nil, join_policy: nil, member_count: nil, moderator_count: nil, name: nil, primary_topic: nil, role: nil, rules: nil) + # @!method initialize(id:, banner_url: nil, created_at: nil, creator: nil, description: nil, invites_policy: nil, is_nsfw: nil, join_policy: nil, member_count: nil, moderator_count: nil, name: nil, primary_topic: nil, rules: nil) # Community info object # # @param id [String] Unique community identifier @@ -126,8 +114,6 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # # @param invites_policy [String] Invitation policy # - # @param is_member [Boolean] Whether the authenticated viewer is a member - # # @param is_nsfw [Boolean] Whether the community is marked sensitive # # @param join_policy [String] Join policy (open or restricted) @@ -140,8 +126,6 @@ class Community < XTwitterScraper::Internal::Type::BaseModel # # @param primary_topic [XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic] Primary topic # - # @param role [String] Authenticated viewer's community role - # # @param rules [Array] Community rules # @see XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community#creator diff --git a/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb b/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb index a076c00..5d1ed6f 100644 --- a/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +++ b/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb @@ -31,10 +31,8 @@ class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -56,7 +54,7 @@ class CommunityRetrieveSearchParams < XTwitterScraper::Internal::Type::BaseModel # # @param cursor [String] Pagination cursor for community search # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param query_type [Symbol, XTwitterScraper::Models::X::CommunityRetrieveSearchParams::QueryType] Sort order (Latest or Top) # diff --git a/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb b/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb index 0edad0c..dfc40f6 100644 --- a/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +++ b/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb @@ -30,10 +30,8 @@ class ListRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel optional :include_replies, XTwitterScraper::Internal::Type::Boolean # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -61,7 +59,7 @@ class ListRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # # @param include_replies [Boolean] Include replies (default false) # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param since_time [String] Unix timestamp - filter after # diff --git a/lib/x_twitter_scraper/models/x/tweet_author.rb b/lib/x_twitter_scraper/models/x/tweet_author.rb index 1bf9e1f..565552d 100644 --- a/lib/x_twitter_scraper/models/x/tweet_author.rb +++ b/lib/x_twitter_scraper/models/x/tweet_author.rb @@ -8,9 +8,22 @@ module XTwitterScraper module Models module X class TweetAuthor < XTwitterScraper::Models::UserProfile - # @!method initialize + # @!attribute followers + # + # @return [Integer] + required :followers, Integer + + # @!attribute verified + # + # @return [Boolean] + required :verified, XTwitterScraper::Internal::Type::Boolean + + # @!method initialize(followers:, verified:) # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. + # + # @param followers [Integer] + # @param verified [Boolean] end end end diff --git a/lib/x_twitter_scraper/models/x/tweet_detail.rb b/lib/x_twitter_scraper/models/x/tweet_detail.rb index beef7c1..c53886c 100644 --- a/lib/x_twitter_scraper/models/x/tweet_detail.rb +++ b/lib/x_twitter_scraper/models/x/tweet_detail.rb @@ -48,6 +48,12 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Integer] required :view_count, Integer, api_name: :viewCount + # @!attribute article + # Article metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::X::TweetDetail::Article, nil] + optional :article, -> { XTwitterScraper::X::TweetDetail::Article } + # @!attribute author # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. @@ -55,6 +61,22 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [XTwitterScraper::Models::X::TweetAuthor, nil] optional :author, -> { XTwitterScraper::X::TweetAuthor } + # @!attribute card + # Public card metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::X::TweetDetail::Card, nil] + optional :card, -> { XTwitterScraper::X::TweetDetail::Card } + + # @!attribute community_note + # Community Note presentation metadata returned by X. + # + # @return [XTwitterScraper::Models::X::TweetDetail::CommunityNote, nil] + optional :community_note, + -> { + XTwitterScraper::X::TweetDetail::CommunityNote + }, + api_name: :communityNote + # @!attribute content_disclosure # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. @@ -81,6 +103,12 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel XTwitterScraper::Internal::Type::ArrayOf[Integer], api_name: :displayTextRange + # @!attribute edit + # Edit history metadata returned by X. + # + # @return [XTwitterScraper::Models::X::TweetDetail::Edit, nil] + optional :edit, -> { XTwitterScraper::X::TweetDetail::Edit } + # @!attribute entities # Parsed entities from the tweet text (URLs, mentions, hashtags, media) # @@ -129,6 +157,11 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply + # @!attribute is_translatable + # + # @return [Boolean, nil] + optional :is_translatable, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslatable + # @!attribute lang # Tweet language code # @@ -141,6 +174,31 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [Array, nil] optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] } + # @!attribute note_tweet + # Complete Note Tweet content and rich-text metadata. + # + # @return [XTwitterScraper::Models::X::TweetDetail::NoteTweet, nil] + optional :note_tweet, -> { XTwitterScraper::X::TweetDetail::NoteTweet }, api_name: :noteTweet + + # @!attribute place + # Public place metadata attached to a tweet. + # + # @return [XTwitterScraper::Models::X::TweetDetail::Place, nil] + optional :place, -> { XTwitterScraper::X::TweetDetail::Place } + + # @!attribute possibly_sensitive + # + # @return [Boolean, nil] + optional :possibly_sensitive, XTwitterScraper::Internal::Type::Boolean, api_name: :possiblySensitive + + # @!attribute previous_counts + # Engagement counts retained from a prior tweet edit. + # + # @return [XTwitterScraper::Models::X::TweetDetail::PreviousCounts, nil] + optional :previous_counts, + -> { XTwitterScraper::X::TweetDetail::PreviousCounts }, + api_name: :previousCounts + # @!attribute quoted_tweet # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, @@ -175,7 +233,12 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :url, String - # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, author: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, lang: nil, media: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil) + # @!attribute view_state + # + # @return [String, nil] + optional :view_state, String, api_name: :viewState + + # @!method initialize(id:, bookmark_count:, like_count:, quote_count:, reply_count:, retweet_count:, text:, view_count:, article: nil, author: nil, card: nil, community_note: nil, content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, edit: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, in_reply_to_username: nil, is_limited_reply: nil, is_note_tweet: nil, is_quote_status: nil, is_reply: nil, is_translatable: nil, lang: nil, media: nil, note_tweet: nil, place: nil, possibly_sensitive: nil, previous_counts: nil, quoted_tweet: nil, retweeted_tweet: nil, source: nil, type: nil, url: nil, view_state: nil) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetDetail} for more details. # @@ -198,8 +261,14 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # # @param view_count [Integer] # + # @param article [XTwitterScraper::Models::X::TweetDetail::Article] Article metadata attached to a tweet. + # # @param author [XTwitterScraper::Models::X::TweetAuthor] Tweet author profile. The lookup route always includes follower count and verifi # + # @param card [XTwitterScraper::Models::X::TweetDetail::Card] Public card metadata attached to a tweet. + # + # @param community_note [XTwitterScraper::Models::X::TweetDetail::CommunityNote] Community Note presentation metadata returned by X. + # # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh # # @param conversation_id [String] ID of the root tweet in the conversation thread @@ -208,6 +277,8 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # # @param display_text_range [Array] Start and end offsets for rendered tweet text # + # @param edit [XTwitterScraper::Models::X::TweetDetail::Edit] Edit history metadata returned by X. + # # @param entities [Hash{Symbol=>Object}] Parsed entities from the tweet text (URLs, mentions, hashtags, media) # # @param in_reply_to_id [String] Tweet ID being replied to @@ -224,10 +295,20 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # # @param is_reply [Boolean] Whether this tweet is a reply to another tweet # + # @param is_translatable [Boolean] + # # @param lang [String] Tweet language code # # @param media [Array] Attached media items, omitted when the tweet has no media # + # @param note_tweet [XTwitterScraper::Models::X::TweetDetail::NoteTweet] Complete Note Tweet content and rich-text metadata. + # + # @param place [XTwitterScraper::Models::X::TweetDetail::Place] Public place metadata attached to a tweet. + # + # @param possibly_sensitive [Boolean] + # + # @param previous_counts [XTwitterScraper::Models::X::TweetDetail::PreviousCounts] Engagement counts retained from a prior tweet edit. + # # @param quoted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen # # @param retweeted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen @@ -237,6 +318,297 @@ class TweetDetail < XTwitterScraper::Internal::Type::BaseModel # @param type [String] Tweet result type # # @param url [String] Tweet permalink URL + # + # @param view_state [String] + + # @see XTwitterScraper::Models::X::TweetDetail#article + class Article < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute cover_media_url + # + # @return [String, nil] + optional :cover_media_url, String, api_name: :coverMediaUrl + + # @!attribute preview_text + # + # @return [String, nil] + optional :preview_text, String, api_name: :previewText + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!method initialize(id: nil, cover_media_url: nil, preview_text: nil, title: nil) + # Article metadata attached to a tweet. + # + # @param id [String] + # @param cover_media_url [String] + # @param preview_text [String] + # @param title [String] + end + + # @see XTwitterScraper::Models::X::TweetDetail#card + class Card < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute binding_values + # + # @return [Hash{Symbol=>Object}, nil] + optional :binding_values, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + api_name: :bindingValues + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id: nil, binding_values: nil, name: nil, url: nil) + # Public card metadata attached to a tweet. + # + # @param id [String] + # @param binding_values [Hash{Symbol=>Object}] + # @param name [String] + # @param url [String] + end + + # @see XTwitterScraper::Models::X::TweetDetail#community_note + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute destination_url + # + # @return [String, nil] + optional :destination_url, String, api_name: :destinationUrl + + # @!attribute footer + # + # @return [String, nil] + optional :footer, String + + # @!attribute short_title + # + # @return [String, nil] + optional :short_title, String, api_name: :shortTitle + + # @!attribute subtitle + # + # @return [String, nil] + optional :subtitle, String + + # @!attribute title + # + # @return [String, nil] + optional :title, String + + # @!attribute visual_style + # + # @return [String, nil] + optional :visual_style, String, api_name: :visualStyle + + # @!method initialize(id: nil, destination_url: nil, footer: nil, short_title: nil, subtitle: nil, title: nil, visual_style: nil) + # Community Note presentation metadata returned by X. + # + # @param id [String] + # @param destination_url [String] + # @param footer [String] + # @param short_title [String] + # @param subtitle [String] + # @param title [String] + # @param visual_style [String] + end + + # @see XTwitterScraper::Models::X::TweetDetail#edit + class Edit < XTwitterScraper::Internal::Type::BaseModel + # @!attribute editable_until_msecs + # + # @return [String, nil] + optional :editable_until_msecs, String, api_name: :editableUntilMsecs + + # @!attribute edit_tweet_ids + # + # @return [Array, nil] + optional :edit_tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :editTweetIds + + # @!method initialize(editable_until_msecs: nil, edit_tweet_ids: nil) + # Edit history metadata returned by X. + # + # @param editable_until_msecs [String] + # @param edit_tweet_ids [Array] + end + + # @see XTwitterScraper::Models::X::TweetDetail#note_tweet + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + # @!attribute text + # + # @return [String] + required :text, String + + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute entities + # + # @return [Hash{Symbol=>Object}, nil] + optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown] + + # @!attribute is_expandable + # + # @return [Boolean, nil] + optional :is_expandable, XTwitterScraper::Internal::Type::Boolean, api_name: :isExpandable + + # @!attribute richtext_tags + # + # @return [Array, nil] + optional :richtext_tags, + -> { + XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] + }, + api_name: :richtextTags + + # @!method initialize(text:, id: nil, entities: nil, is_expandable: nil, richtext_tags: nil) + # Complete Note Tweet content and rich-text metadata. + # + # @param text [String] + # @param id [String] + # @param entities [Hash{Symbol=>Object}] + # @param is_expandable [Boolean] + # @param richtext_tags [Array] + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + # @!attribute from_index + # + # @return [Integer] + required :from_index, Integer, api_name: :fromIndex + + # @!attribute to_index + # + # @return [Integer] + required :to_index, Integer, api_name: :toIndex + + # @!attribute types + # + # @return [Array] + required :types, XTwitterScraper::Internal::Type::ArrayOf[String] + + # @!method initialize(from_index:, to_index:, types:) + # @param from_index [Integer] + # @param to_index [Integer] + # @param types [Array] + end + end + + # @see XTwitterScraper::Models::X::TweetDetail#place + class Place < XTwitterScraper::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute bounding_box + # + # @return [Hash{Symbol=>Object}, nil] + optional :bounding_box, + XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown], + api_name: :boundingBox + + # @!attribute country + # + # @return [String, nil] + optional :country, String + + # @!attribute country_code + # + # @return [String, nil] + optional :country_code, String, api_name: :countryCode + + # @!attribute full_name + # + # @return [String, nil] + optional :full_name, String, api_name: :fullName + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute place_type + # + # @return [String, nil] + optional :place_type, String, api_name: :placeType + + # @!attribute url + # + # @return [String, nil] + optional :url, String + + # @!method initialize(id: nil, bounding_box: nil, country: nil, country_code: nil, full_name: nil, name: nil, place_type: nil, url: nil) + # Public place metadata attached to a tweet. + # + # @param id [String] + # @param bounding_box [Hash{Symbol=>Object}] + # @param country [String] + # @param country_code [String] + # @param full_name [String] + # @param name [String] + # @param place_type [String] + # @param url [String] + end + + # @see XTwitterScraper::Models::X::TweetDetail#previous_counts + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + # @!attribute bookmark_count + # + # @return [Integer, nil] + optional :bookmark_count, Integer, api_name: :bookmarkCount + + # @!attribute like_count + # + # @return [Integer, nil] + optional :like_count, Integer, api_name: :likeCount + + # @!attribute quote_count + # + # @return [Integer, nil] + optional :quote_count, Integer, api_name: :quoteCount + + # @!attribute reply_count + # + # @return [Integer, nil] + optional :reply_count, Integer, api_name: :replyCount + + # @!attribute retweet_count + # + # @return [Integer, nil] + optional :retweet_count, Integer, api_name: :retweetCount + + # @!method initialize(bookmark_count: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil) + # Engagement counts retained from a prior tweet edit. + # + # @param bookmark_count [Integer] + # @param like_count [Integer] + # @param quote_count [Integer] + # @param reply_count [Integer] + # @param retweet_count [Integer] + end end end end 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 06c71cd..f7fc468 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 @@ -121,10 +121,8 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_retweets, Integer # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -242,7 +240,7 @@ class TweetGetQuotesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Quotes] Quote mode. # 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 e77e581..adcbd02 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 @@ -78,6 +78,14 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :language, String + # @!attribute limit + # With mode=complete, maximum combined direct and nested reply rows (1-25000). + # Without complete mode, this is the deprecated pageSize alias and uses the normal + # 1-100 page range. + # + # @return [Integer, nil] + optional :limit, Integer + # @!attribute media_type # Filter by media type. # @@ -114,11 +122,16 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :min_retweets, Integer + # @!attribute mode + # Set complete for maximum-coverage collection. Complete mode accepts only limit. + # Remove cursor, pageSize, count, time ranges, and tweet filters. + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Mode, nil] + optional :mode, enum: -> { XTwitterScraper::X::TweetGetRepliesParams::Mode } + # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -196,7 +209,7 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # @return [Boolean, nil] optional :verified_only, XTwitterScraper::Internal::Type::Boolean - # @!method initialize(id:, any_words: 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, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # @!method initialize(id:, any_words: 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, limit: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, mode: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetGetRepliesParams} for more details. # @@ -222,6 +235,8 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # # @param language [String] Language code filter, e.g. en or tr. # + # @param limit [Integer] With mode=complete, maximum combined direct and nested reply rows (1-25000). Wit + # # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::MediaType] Filter by media type. # # @param mentioning [String] Filter tweets mentioning a username. @@ -234,7 +249,9 @@ class TweetGetRepliesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param mode [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Mode] Set complete for maximum-coverage collection. Complete mode accepts only limit. + # + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Quotes] Quote mode. # @@ -277,6 +294,17 @@ module MediaType # @return [Array] end + # Set complete for maximum-coverage collection. Complete mode accepts only limit. + # Remove cursor, pageSize, count, time ranges, and tweet filters. + module Mode + extend XTwitterScraper::Internal::Type::Enum + + COMPLETE = :complete + + # @!method self.values + # @return [Array] + end + # Quote mode. module Quotes extend XTwitterScraper::Internal::Type::Enum diff --git a/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb b/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb new file mode 100644 index 0000000..4576ec0 --- /dev/null +++ b/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb @@ -0,0 +1,345 @@ +# frozen_string_literal: true + +module XTwitterScraper + module Models + module X + # @see XTwitterScraper::Resources::X::Tweets#get_replies + class TweetGetRepliesResponse < XTwitterScraper::Models::PaginatedTweets + # @!attribute diagnostic + # Evidence for direct-reply coverage and collector behavior. + # + # @return [XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic, nil] + optional :diagnostic, -> { XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic } + + # @!attribute nested_replies + # Nested replies. Excluded from direct coverage. + # + # @return [Array, nil] + optional :nested_replies, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet] } + + # @!method initialize(diagnostic: nil, nested_replies: nil) + # Reply rows. Complete mode also returns nested replies and coverage diagnostics. + # Keep nested replies separate from direct coverage. + # + # @param diagnostic [XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic] Evidence for direct-reply coverage and collector behavior. + # + # @param nested_replies [Array] Nested replies. Excluded from direct coverage. + + class Diagnostic < XTwitterScraper::Internal::Type::BaseModel + # @!attribute complete + # Whether coverage met the target without truncation. + # + # @return [Boolean] + required :complete, XTwitterScraper::Internal::Type::Boolean + + # @!attribute coverage_percentage + # Unique direct replies as a percentage of the reported count. + # + # @return [Float] + required :coverage_percentage, Float, api_name: :coveragePercentage + + # @!attribute cursor_failures + # Cursor requests that failed. + # + # @return [Integer] + required :cursor_failures, Integer, api_name: :cursorFailures + + # @!attribute duplicate_count + # Duplicate tweet IDs removed across pages and strategies. + # + # @return [Integer] + required :duplicate_count, Integer, api_name: :duplicateCount + + # @!attribute empty_false_progress_pages + # Empty pages rejected because they did not make progress. + # + # @return [Integer] + required :empty_false_progress_pages, Integer, api_name: :emptyFalseProgressPages + + # @!attribute malformed_count + # Malformed response items rejected. + # + # @return [Integer] + required :malformed_count, Integer, api_name: :malformedCount + + # @!attribute missing_response_modules_or_fields + # Expected response modules or fields missing from X. + # + # @return [Array] + required :missing_response_modules_or_fields, + XTwitterScraper::Internal::Type::ArrayOf[String], + api_name: :missingResponseModulesOrFields + + # @!attribute nested_reply_count + # Unique nested replies kept outside direct coverage. + # + # @return [Integer] + required :nested_reply_count, Integer, api_name: :nestedReplyCount + + # @!attribute pages_attempted + # Total pages attempted across all strategies. + # + # @return [Integer] + required :pages_attempted, Integer, api_name: :pagesAttempted + + # @!attribute recommended_fallback + # Recommended next action when coverage is incomplete. + # + # @return [String] + required :recommended_fallback, String, api_name: :recommendedFallback + + # @!attribute repeated_cursor_count + # Repeated cursors rejected to prevent loops. + # + # @return [Integer] + required :repeated_cursor_count, Integer, api_name: :repeatedCursorCount + + # @!attribute reported_reply_count + # Reply count reported on the source post. + # + # @return [Integer] + required :reported_reply_count, Integer, api_name: :reportedReplyCount + + # @!attribute response_truncated + # Whether the requested row limit truncated safe results. + # + # @return [Boolean] + required :response_truncated, XTwitterScraper::Internal::Type::Boolean, api_name: :responseTruncated + + # @!attribute richness + # Field-presence counts across the collected direct replies. + # + # @return [XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness] + required :richness, -> { XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness } + + # @!attribute strategies_attempted + # Per-strategy pagination and contribution evidence. + # + # @return [Array] + required :strategies_attempted, + -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted] }, + api_name: :strategiesAttempted + + # @!attribute target_direct_replies + # Minimum direct replies required for the coverage target. + # + # @return [Integer] + required :target_direct_replies, Integer, api_name: :targetDirectReplies + + # @!attribute unique_direct_replies + # Unique replies whose parent ID equals the source post ID. + # + # @return [Integer] + required :unique_direct_replies, Integer, api_name: :uniqueDirectReplies + + # @!attribute unrelated_count + # Tweets rejected because they belonged elsewhere. + # + # @return [Integer] + required :unrelated_count, Integer, api_name: :unrelatedCount + + # @!method initialize(complete:, coverage_percentage:, cursor_failures:, duplicate_count:, empty_false_progress_pages:, malformed_count:, missing_response_modules_or_fields:, nested_reply_count:, pages_attempted:, recommended_fallback:, repeated_cursor_count:, reported_reply_count:, response_truncated:, richness:, strategies_attempted:, target_direct_replies:, unique_direct_replies:, unrelated_count:) + # Evidence for direct-reply coverage and collector behavior. + # + # @param complete [Boolean] Whether coverage met the target without truncation. + # + # @param coverage_percentage [Float] Unique direct replies as a percentage of the reported count. + # + # @param cursor_failures [Integer] Cursor requests that failed. + # + # @param duplicate_count [Integer] Duplicate tweet IDs removed across pages and strategies. + # + # @param empty_false_progress_pages [Integer] Empty pages rejected because they did not make progress. + # + # @param malformed_count [Integer] Malformed response items rejected. + # + # @param missing_response_modules_or_fields [Array] Expected response modules or fields missing from X. + # + # @param nested_reply_count [Integer] Unique nested replies kept outside direct coverage. + # + # @param pages_attempted [Integer] Total pages attempted across all strategies. + # + # @param recommended_fallback [String] Recommended next action when coverage is incomplete. + # + # @param repeated_cursor_count [Integer] Repeated cursors rejected to prevent loops. + # + # @param reported_reply_count [Integer] Reply count reported on the source post. + # + # @param response_truncated [Boolean] Whether the requested row limit truncated safe results. + # + # @param richness [XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness] Field-presence counts across the collected direct replies. + # + # @param strategies_attempted [Array] Per-strategy pagination and contribution evidence. + # + # @param target_direct_replies [Integer] Minimum direct replies required for the coverage target. + # + # @param unique_direct_replies [Integer] Unique replies whose parent ID equals the source post ID. + # + # @param unrelated_count [Integer] Tweets rejected because they belonged elsewhere. + + # @see XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic#richness + class Richness < XTwitterScraper::Internal::Type::BaseModel + # @!attribute article + # Replies with article content. + # + # @return [Integer] + required :article, Integer + + # @!attribute author + # Replies with author details. + # + # @return [Integer] + required :author, Integer + + # @!attribute card + # Replies with card metadata. + # + # @return [Integer] + required :card, Integer + + # @!attribute community_note + # Replies with community-note data. + # + # @return [Integer] + required :community_note, Integer, api_name: :communityNote + + # @!attribute created_at + # Replies with a creation timestamp. + # + # @return [Integer] + required :created_at, Integer, api_name: :createdAt + + # @!attribute engagement_counts + # Replies with engagement counts. + # + # @return [Integer] + required :engagement_counts, Integer, api_name: :engagementCounts + + # @!attribute entities + # Replies with entity metadata. + # + # @return [Integer] + required :entities, Integer + + # @!attribute language + # Replies with a language value. + # + # @return [Integer] + required :language, Integer + + # @!attribute media + # Replies with media metadata. + # + # @return [Integer] + required :media, Integer + + # @!attribute quoted_or_reposted_tweet + # Replies with quoted or reposted tweet data. + # + # @return [Integer] + required :quoted_or_reposted_tweet, Integer, api_name: :quotedOrRepostedTweet + + # @!attribute text + # Replies with text. + # + # @return [Integer] + required :text, Integer + + # @!attribute total_replies + # Total unique direct replies evaluated for richness. + # + # @return [Integer] + required :total_replies, Integer, api_name: :totalReplies + + # @!attribute url + # Replies with a canonical URL. + # + # @return [Integer] + required :url, Integer + + # @!method initialize(article:, author:, card:, community_note:, created_at:, engagement_counts:, entities:, language:, media:, quoted_or_reposted_tweet:, text:, total_replies:, url:) + # Field-presence counts across the collected direct replies. + # + # @param article [Integer] Replies with article content. + # + # @param author [Integer] Replies with author details. + # + # @param card [Integer] Replies with card metadata. + # + # @param community_note [Integer] Replies with community-note data. + # + # @param created_at [Integer] Replies with a creation timestamp. + # + # @param engagement_counts [Integer] Replies with engagement counts. + # + # @param entities [Integer] Replies with entity metadata. + # + # @param language [Integer] Replies with a language value. + # + # @param media [Integer] Replies with media metadata. + # + # @param quoted_or_reposted_tweet [Integer] Replies with quoted or reposted tweet data. + # + # @param text [Integer] Replies with text. + # + # @param total_replies [Integer] Total unique direct replies evaluated for richness. + # + # @param url [Integer] Replies with a canonical URL. + end + + class StrategiesAttempted < XTwitterScraper::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute new_direct_replies + # + # @return [Integer] + required :new_direct_replies, Integer, api_name: :newDirectReplies + + # @!attribute new_nested_replies + # + # @return [Integer] + required :new_nested_replies, Integer, api_name: :newNestedReplies + + # @!attribute pages_attempted + # + # @return [Integer] + required :pages_attempted, Integer, api_name: :pagesAttempted + + # @!attribute stop_reason + # + # @return [Symbol, XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason] + required :stop_reason, + enum: -> { XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason }, + api_name: :stopReason + + # @!method initialize(name:, new_direct_replies:, new_nested_replies:, pages_attempted:, stop_reason:) + # @param name [String] + # @param new_direct_replies [Integer] + # @param new_nested_replies [Integer] + # @param pages_attempted [Integer] + # @param stop_reason [Symbol, XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason] + + # @see XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted#stop_reason + module StopReason + extend XTwitterScraper::Internal::Type::Enum + + DEADLINE = :deadline + EMPTY_PAGES = :empty_pages + ERROR = :error + MISSING_CURSOR = :missing_cursor + NO_NEXT_PAGE = :no_next_page + PAGE_CAP = :page_cap + REPEATED_CURSOR = :repeated_cursor + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end 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 749301d..22b9ab9 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 @@ -24,10 +24,8 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel optional :cursor, String # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -41,7 +39,7 @@ class TweetGetThreadParams < XTwitterScraper::Internal::Type::BaseModel # # @param cursor [String] Pagination cursor for thread tweets # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}] end 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 43e99d5..246a24a 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 @@ -115,10 +115,8 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_retweets, Integer # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -222,7 +220,7 @@ class UserRetrieveLikesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Quotes] Quote mode. # 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 05685dd..9536ba9 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 @@ -115,10 +115,8 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel optional :min_retweets, Integer # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -222,7 +220,7 @@ class UserRetrieveMediaParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Quotes] Quote mode. # 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 fe28656..ecb24a6 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 @@ -115,10 +115,8 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel optional :min_retweets, Integer # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -234,7 +232,7 @@ class UserRetrieveMentionsParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Quotes] Quote mode. # 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 4ac032b..ef834ea 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 @@ -121,10 +121,8 @@ class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel optional :min_retweets, Integer # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -230,7 +228,7 @@ class UserRetrieveRepliesParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Quotes] Quote mode. # 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 b88da5a..bde1227 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 @@ -127,10 +127,8 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel optional :min_retweets, Integer # @!attribute page_size - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. # # @return [Integer, nil] @@ -238,7 +236,7 @@ class UserRetrieveTweetsParams < XTwitterScraper::Internal::Type::BaseModel # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Quotes] Quote mode. # diff --git a/lib/x_twitter_scraper/models/x_get_article_response.rb b/lib/x_twitter_scraper/models/x_get_article_response.rb index 06148f3..e597b5b 100644 --- a/lib/x_twitter_scraper/models/x_get_article_response.rb +++ b/lib/x_twitter_scraper/models/x_get_article_response.rb @@ -203,11 +203,6 @@ class Author < XTwitterScraper::Internal::Type::BaseModel # @return [String] required :username, String - # @!attribute can_dm - # - # @return [Boolean, nil] - optional :can_dm, XTwitterScraper::Internal::Type::Boolean, api_name: :canDm - # @!attribute created_at # # @return [String, nil] @@ -283,13 +278,12 @@ class Author < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :url, String - # @!method initialize(id:, name:, username:, can_dm: nil, created_at: nil, description: nil, favourites_count: nil, followers_count: nil, following_count: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, url: nil) + # @!method initialize(id:, name:, username:, created_at: nil, description: nil, favourites_count: nil, followers_count: nil, following_count: nil, is_blue_verified: nil, is_translator: nil, is_verified: nil, location: nil, media_count: nil, profile_banner_url: nil, profile_picture: nil, protected: nil, statuses_count: nil, url: nil) # X Article author profile fields returned when available. # # @param id [String] # @param name [String] # @param username [String] - # @param can_dm [Boolean] # @param created_at [String] # @param description [String] # @param favourites_count [Integer] diff --git a/lib/x_twitter_scraper/models/x_get_trends_response.rb b/lib/x_twitter_scraper/models/x_get_trends_response.rb index 64d0dd7..644e9f4 100644 --- a/lib/x_twitter_scraper/models/x_get_trends_response.rb +++ b/lib/x_twitter_scraper/models/x_get_trends_response.rb @@ -40,6 +40,12 @@ class Trend < XTwitterScraper::Internal::Type::BaseModel # @return [String, nil] optional :description, String + # @!attribute promoted_content + # Promotion identifier from X. Null for organic trends. + # + # @return [String, nil] + optional :promoted_content, String, api_name: :promotedContent, nil?: true + # @!attribute query # # @return [String, nil] @@ -50,11 +56,32 @@ class Trend < XTwitterScraper::Internal::Type::BaseModel # @return [Integer, nil] optional :rank, Integer - # @!method initialize(name:, description: nil, query: nil, rank: nil) + # @!attribute tweet_volume + # Approximate public post volume when X supplies it. + # + # @return [Integer, nil] + optional :tweet_volume, Integer, api_name: :tweetVolume, nil?: true + + # @!attribute url + # X search URL for the trend. + # + # @return [String, nil] + optional :url, String + + # @!method initialize(name:, description: nil, promoted_content: nil, query: nil, rank: nil, tweet_volume: nil, url: nil) # @param name [String] + # # @param description [String] + # + # @param promoted_content [String, nil] Promotion identifier from X. Null for organic trends. + # # @param query [String] + # # @param rank [Integer] + # + # @param tweet_volume [Integer, nil] Approximate public post volume when X supplies it. + # + # @param url [String] X search URL for the trend. end end end diff --git a/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb b/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb index b1b9aee..39dbb82 100644 --- a/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +++ b/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb @@ -13,7 +13,7 @@ class AccountConnectionAttempts # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge] + # @return [XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode] # # @see XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveParams def retrieve(id, params = {}) diff --git a/lib/x_twitter_scraper/resources/x/accounts.rb b/lib/x_twitter_scraper/resources/x/accounts.rb index 7173624..b526be7 100644 --- a/lib/x_twitter_scraper/resources/x/accounts.rb +++ b/lib/x_twitter_scraper/resources/x/accounts.rb @@ -23,7 +23,7 @@ class Accounts # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [Object] + # @return [XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount, XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending, XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge] # # @see XTwitterScraper::Models::X::AccountCreateParams def create(params) @@ -32,7 +32,7 @@ def create(params) method: :post, path: "x/accounts", body: parsed, - model: XTwitterScraper::Internal::Type::Unknown, + model: XTwitterScraper::Models::X::AccountCreateResponse, options: options ) end diff --git a/lib/x_twitter_scraper/resources/x/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index 24f3bd7..390dfcb 100644 --- a/lib/x_twitter_scraper/resources/x/communities.rb +++ b/lib/x_twitter_scraper/resources/x/communities.rb @@ -170,7 +170,7 @@ def retrieve_moderators(id, params = {}) # # @param cursor [String] Pagination cursor for community search # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param query_type [Symbol, XTwitterScraper::Models::X::CommunityRetrieveSearchParams::QueryType] Sort order (Latest or Top) # diff --git a/lib/x_twitter_scraper/resources/x/communities/tweets.rb b/lib/x_twitter_scraper/resources/x/communities/tweets.rb index 7593829..6b059bb 100644 --- a/lib/x_twitter_scraper/resources/x/communities/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/communities/tweets.rb @@ -23,7 +23,7 @@ class Tweets # # @param cursor [String] Pagination cursor for community results # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param query_type [Symbol, XTwitterScraper::Models::X::Communities::TweetListParams::QueryType] Sort order for community results (Latest or Top) # @@ -60,7 +60,7 @@ def list(params) # # @param cursor [String] Pagination cursor for community tweets # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/lists.rb b/lib/x_twitter_scraper/resources/x/lists.rb index 4e72d63..bf89454 100644 --- a/lib/x_twitter_scraper/resources/x/lists.rb +++ b/lib/x_twitter_scraper/resources/x/lists.rb @@ -79,7 +79,7 @@ def retrieve_members(id, params = {}) # # @param include_replies [Boolean] Include replies (default false) # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param since_time [String] Unix timestamp - filter after # diff --git a/lib/x_twitter_scraper/resources/x/tweets.rb b/lib/x_twitter_scraper/resources/x/tweets.rb index 775e388..4d02165 100644 --- a/lib/x_twitter_scraper/resources/x/tweets.rb +++ b/lib/x_twitter_scraper/resources/x/tweets.rb @@ -204,7 +204,7 @@ def get_favoriters(id, params = {}) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetQuotesParams::Quotes] Quote mode. # @@ -272,13 +272,12 @@ def get_quotes(id, params = {}) # Some parameter documentations has been truncated, see # {XTwitterScraper::Models::X::TweetGetRepliesParams} for more details. # - # Returns visible replies. For an unfiltered first page, Xquik compares a terminal - # page with the post's reported reply count. If the page is visibly incomplete, - # the endpoint returns 424 `replies_incomplete` instead of presenting partial - # coverage as complete. Use tweet search with a `conversation_id:{id}` query as - # the broader fallback. + # Returns direct replies. Complete mode merges available timeline views, supported + # rankings, every forward cursor module, labeled hidden-content branches, + # exact-parent time partitions scaled to the reported reply count, and search. It + # separates nested replies and returns 424 below 80% coverage. # - # @overload get_replies(id, any_words: 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, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) + # @overload get_replies(id, any_words: 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, limit: nil, media_type: nil, mentioning: nil, min_faves: nil, min_quotes: nil, min_replies: nil, min_retweets: nil, mode: nil, page_size: nil, quotes: nil, quotes_of_tweet_id: nil, replies: nil, retweets: nil, retweets_of_tweet_id: nil, since_date: nil, since_time: nil, to_user: nil, until_date: nil, until_time: nil, url: nil, verified_only: nil, request_options: {}) # # @param id [String] Tweet ID to get replies # @@ -302,6 +301,8 @@ def get_quotes(id, params = {}) # # @param language [String] Language code filter, e.g. en or tr. # + # @param limit [Integer] With mode=complete, maximum combined direct and nested reply rows (1-25000). Wit + # # @param media_type [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::MediaType] Filter by media type. # # @param mentioning [String] Filter tweets mentioning a username. @@ -314,7 +315,9 @@ def get_quotes(id, params = {}) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param mode [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Mode] Set complete for maximum-coverage collection. Complete mode accepts only limit. + # + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::TweetGetRepliesParams::Quotes] Quote mode. # @@ -342,7 +345,7 @@ def get_quotes(id, params = {}) # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # - # @return [XTwitterScraper::Models::PaginatedTweets] + # @return [XTwitterScraper::Models::X::TweetGetRepliesResponse] # # @see XTwitterScraper::Models::X::TweetGetRepliesParams def get_replies(id, params = {}) @@ -373,7 +376,7 @@ def get_replies(id, params = {}) until_time: "untilTime", verified_only: "verifiedOnly" ), - model: XTwitterScraper::PaginatedTweets, + model: XTwitterScraper::Models::X::TweetGetRepliesResponse, options: options ) end @@ -419,7 +422,7 @@ def get_retweeters(id, params = {}) # # @param cursor [String] Pagination cursor for thread tweets # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil] # diff --git a/lib/x_twitter_scraper/resources/x/users.rb b/lib/x_twitter_scraper/resources/x/users.rb index 1686025..d33569d 100644 --- a/lib/x_twitter_scraper/resources/x/users.rb +++ b/lib/x_twitter_scraper/resources/x/users.rb @@ -229,7 +229,7 @@ def retrieve_following(id, params = {}) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveLikesParams::Quotes] Quote mode. # @@ -328,7 +328,7 @@ def retrieve_likes(id, params = {}) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMediaParams::Quotes] Quote mode. # @@ -427,7 +427,7 @@ def retrieve_media(id, params = {}) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveMentionsParams::Quotes] Quote mode. # @@ -534,7 +534,7 @@ def retrieve_mentions(id, params = {}) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveRepliesParams::Quotes] Quote mode. # @@ -663,7 +663,7 @@ def retrieve_search(params) # # @param min_retweets [Integer] Minimum retweets threshold. # - # @param page_size [Integer] Maximum items requested from this page (1-100, default 20). The response can con + # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r # # @param quotes [Symbol, XTwitterScraper::Models::X::UserRetrieveTweetsParams::Quotes] Quote mode. # diff --git a/rbi/x_twitter_scraper/models/content_disclosure.rbi b/rbi/x_twitter_scraper/models/content_disclosure.rbi index 791b68f..ff03755 100644 --- a/rbi/x_twitter_scraper/models/content_disclosure.rbi +++ b/rbi/x_twitter_scraper/models/content_disclosure.rbi @@ -98,13 +98,6 @@ module XTwitterScraper ) end - # Whether the disclosure can be edited on X. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :can_edit - - sig { params(can_edit: T::Boolean).void } - attr_writer :can_edit - # Source of the AI-generated media disclosure. sig { returns(T.nilable(String)) } attr_reader :detection_source @@ -121,14 +114,11 @@ module XTwitterScraper sig do params( - can_edit: T::Boolean, detection_source: String, has_ai_generated_media: T::Boolean ).returns(T.attached_class) end def self.new( - # Whether the disclosure can be edited on X. - can_edit: nil, # Source of the AI-generated media disclosure. detection_source: nil, # True when X labels the tweet as containing AI-generated media. @@ -138,11 +128,7 @@ module XTwitterScraper sig do override.returns( - { - can_edit: T::Boolean, - detection_source: String, - has_ai_generated_media: T::Boolean - } + { detection_source: String, has_ai_generated_media: T::Boolean } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/embedded_tweet.rbi b/rbi/x_twitter_scraper/models/embedded_tweet.rbi index 4778e90..5c614ea 100644 --- a/rbi/x_twitter_scraper/models/embedded_tweet.rbi +++ b/rbi/x_twitter_scraper/models/embedded_tweet.rbi @@ -39,6 +39,15 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :view_count + # Article metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::Article)) } + attr_reader :article + + sig do + params(article: XTwitterScraper::EmbeddedTweet::Article::OrHash).void + end + attr_writer :article + # X user profile with bio, follower counts, and verification status. sig { returns(T.nilable(XTwitterScraper::UserProfile)) } attr_reader :author @@ -46,6 +55,24 @@ module XTwitterScraper sig { params(author: XTwitterScraper::UserProfile::OrHash).void } attr_writer :author + # Public card metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::Card)) } + attr_reader :card + + sig { params(card: XTwitterScraper::EmbeddedTweet::Card::OrHash).void } + attr_writer :card + + # Community Note presentation metadata returned by X. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::CommunityNote)) } + attr_reader :community_note + + sig do + params( + community_note: XTwitterScraper::EmbeddedTweet::CommunityNote::OrHash + ).void + end + attr_writer :community_note + # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) } @@ -76,6 +103,13 @@ module XTwitterScraper sig { params(display_text_range: T::Array[Integer]).void } attr_writer :display_text_range + # Edit history metadata returned by X. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::Edit)) } + attr_reader :edit + + sig { params(edit: XTwitterScraper::EmbeddedTweet::Edit::OrHash).void } + attr_writer :edit + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :entities @@ -124,6 +158,12 @@ module XTwitterScraper sig { params(is_reply: T::Boolean).void } attr_writer :is_reply + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_translatable + + sig { params(is_translatable: T::Boolean).void } + attr_writer :is_translatable + sig { returns(T.nilable(String)) } attr_reader :lang @@ -136,6 +176,60 @@ module XTwitterScraper sig { params(media: T::Array[XTwitterScraper::TweetMedia::OrHash]).void } attr_writer :media + # Complete Note Tweet content and rich-text metadata. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::NoteTweet)) } + attr_reader :note_tweet + + sig do + params( + note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet::OrHash + ).void + end + attr_writer :note_tweet + + # Public place metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::Place)) } + attr_reader :place + + sig { params(place: XTwitterScraper::EmbeddedTweet::Place::OrHash).void } + attr_writer :place + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :possibly_sensitive + + sig { params(possibly_sensitive: T::Boolean).void } + attr_writer :possibly_sensitive + + # Engagement counts retained from a prior tweet edit. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet::PreviousCounts)) } + attr_reader :previous_counts + + sig do + params( + previous_counts: + XTwitterScraper::EmbeddedTweet::PreviousCounts::OrHash + ).void + end + attr_writer :previous_counts + + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet)) } + attr_reader :quoted_tweet + + sig { params(quoted_tweet: XTwitterScraper::EmbeddedTweet).void } + attr_writer :quoted_tweet + + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + sig { returns(T.nilable(XTwitterScraper::EmbeddedTweet)) } + attr_reader :retweeted_tweet + + sig { params(retweeted_tweet: XTwitterScraper::EmbeddedTweet).void } + attr_writer :retweeted_tweet + sig { returns(T.nilable(String)) } attr_reader :source @@ -154,6 +248,12 @@ module XTwitterScraper sig { params(url: String).void } attr_writer :url + sig { returns(T.nilable(String)) } + attr_reader :view_state + + sig { params(view_state: String).void } + attr_writer :view_state + # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, # media, and conversation fields appear when available. @@ -167,11 +267,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::EmbeddedTweet::Article::OrHash, author: XTwitterScraper::UserProfile::OrHash, + card: XTwitterScraper::EmbeddedTweet::Card::OrHash, + community_note: XTwitterScraper::EmbeddedTweet::CommunityNote::OrHash, content_disclosure: XTwitterScraper::ContentDisclosure::OrHash, conversation_id: String, created_at: String, display_text_range: T::Array[Integer], + edit: XTwitterScraper::EmbeddedTweet::Edit::OrHash, entities: T::Hash[Symbol, T.anything], in_reply_to_id: String, in_reply_to_user_id: String, @@ -180,11 +284,20 @@ module XTwitterScraper is_note_tweet: T::Boolean, is_quote_status: T::Boolean, is_reply: T::Boolean, + is_translatable: T::Boolean, lang: String, media: T::Array[XTwitterScraper::TweetMedia::OrHash], + note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet::OrHash, + place: XTwitterScraper::EmbeddedTweet::Place::OrHash, + possibly_sensitive: T::Boolean, + previous_counts: + XTwitterScraper::EmbeddedTweet::PreviousCounts::OrHash, + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String ).returns(T.attached_class) end def self.new( @@ -196,14 +309,22 @@ module XTwitterScraper retweet_count:, text:, view_count:, + # Article metadata attached to a tweet. + article: nil, # X user profile with bio, follower counts, and verification status. author: nil, + # Public card metadata attached to a tweet. + card: nil, + # Community Note presentation metadata returned by X. + community_note: nil, # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. content_disclosure: nil, conversation_id: nil, created_at: nil, display_text_range: nil, + # Edit history metadata returned by X. + edit: nil, entities: nil, in_reply_to_id: nil, in_reply_to_user_id: nil, @@ -212,11 +333,28 @@ module XTwitterScraper is_note_tweet: nil, is_quote_status: nil, is_reply: nil, + is_translatable: nil, lang: nil, media: nil, + # Complete Note Tweet content and rich-text metadata. + note_tweet: nil, + # Public place metadata attached to a tweet. + place: nil, + possibly_sensitive: nil, + # Engagement counts retained from a prior tweet edit. + previous_counts: nil, + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + quoted_tweet: nil, + # Quoted or retweeted tweet context. Every object includes id, text, and + # engagement metrics. A zero metric can mean X did not report the count. Author, + # media, and conversation fields appear when available. + retweeted_tweet: nil, source: nil, type: nil, - url: nil + url: nil, + view_state: nil ) end @@ -231,11 +369,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::EmbeddedTweet::Article, author: XTwitterScraper::UserProfile, + card: XTwitterScraper::EmbeddedTweet::Card, + community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: T::Array[Integer], + edit: XTwitterScraper::EmbeddedTweet::Edit, entities: T::Hash[Symbol, T.anything], in_reply_to_id: String, in_reply_to_user_id: String, @@ -244,16 +386,579 @@ module XTwitterScraper is_note_tweet: T::Boolean, is_quote_status: T::Boolean, is_reply: T::Boolean, + is_translatable: T::Boolean, lang: String, media: T::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, + place: XTwitterScraper::EmbeddedTweet::Place, + possibly_sensitive: T::Boolean, + previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } ) end def to_hash end + + class Article < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::Article, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :cover_media_url + + sig { params(cover_media_url: String).void } + attr_writer :cover_media_url + + sig { returns(T.nilable(String)) } + attr_reader :preview_text + + sig { params(preview_text: String).void } + attr_writer :preview_text + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # Article metadata attached to a tweet. + sig do + params( + id: String, + cover_media_url: String, + preview_text: String, + title: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + cover_media_url: nil, + preview_text: nil, + title: nil + ) + end + + sig do + override.returns( + { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + ) + end + def to_hash + end + end + + class Card < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::Card, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :binding_values + + sig { params(binding_values: T::Hash[Symbol, T.anything]).void } + attr_writer :binding_values + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Public card metadata attached to a tweet. + sig do + params( + id: String, + binding_values: T::Hash[Symbol, T.anything], + name: String, + url: String + ).returns(T.attached_class) + end + def self.new(id: nil, binding_values: nil, name: nil, url: nil) + end + + sig do + override.returns( + { + id: String, + binding_values: T::Hash[Symbol, T.anything], + name: String, + url: String + } + ) + end + def to_hash + end + end + + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::CommunityNote, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :destination_url + + sig { params(destination_url: String).void } + attr_writer :destination_url + + sig { returns(T.nilable(String)) } + attr_reader :footer + + sig { params(footer: String).void } + attr_writer :footer + + sig { returns(T.nilable(String)) } + attr_reader :short_title + + sig { params(short_title: String).void } + attr_writer :short_title + + sig { returns(T.nilable(String)) } + attr_reader :subtitle + + sig { params(subtitle: String).void } + attr_writer :subtitle + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + sig { returns(T.nilable(String)) } + attr_reader :visual_style + + sig { params(visual_style: String).void } + attr_writer :visual_style + + # Community Note presentation metadata returned by X. + sig do + params( + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + destination_url: nil, + footer: nil, + short_title: nil, + subtitle: nil, + title: nil, + visual_style: nil + ) + end + + sig do + override.returns( + { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + ) + end + def to_hash + end + end + + class Edit < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::Edit, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :editable_until_msecs + + sig { params(editable_until_msecs: String).void } + attr_writer :editable_until_msecs + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :edit_tweet_ids + + sig { params(edit_tweet_ids: T::Array[String]).void } + attr_writer :edit_tweet_ids + + # Edit history metadata returned by X. + sig do + params( + editable_until_msecs: String, + edit_tweet_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new(editable_until_msecs: nil, edit_tweet_ids: nil) + end + + sig do + override.returns( + { editable_until_msecs: String, edit_tweet_ids: T::Array[String] } + ) + end + def to_hash + end + end + + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::NoteTweet, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :text + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :entities + + sig { params(entities: T::Hash[Symbol, T.anything]).void } + attr_writer :entities + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_expandable + + sig { params(is_expandable: T::Boolean).void } + attr_writer :is_expandable + + sig do + returns( + T.nilable( + T::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + ) + ) + end + attr_reader :richtext_tags + + sig do + params( + richtext_tags: + T::Array[ + XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag::OrHash + ] + ).void + end + attr_writer :richtext_tags + + # Complete Note Tweet content and rich-text metadata. + sig do + params( + text: String, + id: String, + entities: T::Hash[Symbol, T.anything], + is_expandable: T::Boolean, + richtext_tags: + T::Array[ + XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + text:, + id: nil, + entities: nil, + is_expandable: nil, + richtext_tags: nil + ) + end + + sig do + override.returns( + { + text: String, + id: String, + entities: T::Hash[Symbol, T.anything], + is_expandable: T::Boolean, + richtext_tags: + T::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + } + ) + end + def to_hash + end + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :from_index + + sig { returns(Integer) } + attr_accessor :to_index + + sig { returns(T::Array[String]) } + attr_accessor :types + + sig do + params( + from_index: Integer, + to_index: Integer, + types: T::Array[String] + ).returns(T.attached_class) + end + def self.new(from_index:, to_index:, types:) + end + + sig do + override.returns( + { + from_index: Integer, + to_index: Integer, + types: T::Array[String] + } + ) + end + def to_hash + end + end + end + + class Place < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::Place, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :bounding_box + + sig { params(bounding_box: T::Hash[Symbol, T.anything]).void } + attr_writer :bounding_box + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :country_code + + sig { params(country_code: String).void } + attr_writer :country_code + + sig { returns(T.nilable(String)) } + attr_reader :full_name + + sig { params(full_name: String).void } + attr_writer :full_name + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :place_type + + sig { params(place_type: String).void } + attr_writer :place_type + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Public place metadata attached to a tweet. + sig do + params( + id: String, + bounding_box: T::Hash[Symbol, T.anything], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + bounding_box: nil, + country: nil, + country_code: nil, + full_name: nil, + name: nil, + place_type: nil, + url: nil + ) + end + + sig do + override.returns( + { + id: String, + bounding_box: T::Hash[Symbol, T.anything], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + ) + end + def to_hash + end + end + + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::EmbeddedTweet::PreviousCounts, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_reader :bookmark_count + + sig { params(bookmark_count: Integer).void } + attr_writer :bookmark_count + + sig { returns(T.nilable(Integer)) } + attr_reader :like_count + + sig { params(like_count: Integer).void } + attr_writer :like_count + + sig { returns(T.nilable(Integer)) } + attr_reader :quote_count + + sig { params(quote_count: Integer).void } + attr_writer :quote_count + + sig { returns(T.nilable(Integer)) } + attr_reader :reply_count + + sig { params(reply_count: Integer).void } + attr_writer :reply_count + + sig { returns(T.nilable(Integer)) } + attr_reader :retweet_count + + sig { params(retweet_count: Integer).void } + attr_writer :retweet_count + + # Engagement counts retained from a prior tweet edit. + sig do + params( + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + ).returns(T.attached_class) + end + def self.new( + bookmark_count: nil, + like_count: nil, + quote_count: nil, + reply_count: nil, + retweet_count: nil + ) + end + + sig do + override.returns( + { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + ) + end + def to_hash + end + end end end end diff --git a/rbi/x_twitter_scraper/models/paginated_tweets.rbi b/rbi/x_twitter_scraper/models/paginated_tweets.rbi index 548148a..0273b07 100644 --- a/rbi/x_twitter_scraper/models/paginated_tweets.rbi +++ b/rbi/x_twitter_scraper/models/paginated_tweets.rbi @@ -24,11 +24,10 @@ module XTwitterScraper sig { returns(T::Array[XTwitterScraper::SearchTweet]) } attr_accessor :tweets - # Paginated tweet results. The item count can be lower than pageSize when the - # source returns fewer tweets, filters remove tweets, or remaining credits cover - # fewer results. Follow next_cursor while has_next_page is true. An empty page can - # still have has_next_page true after filtering. Zero affordable results returns - # 402 insufficient_credits. + # Paginated tweets. Source visibility, filters, or remaining credits can reduce + # results. An empty filtered page can still have has_next_page true. Follow + # next_cursor while has_next_page is true. Zero affordable results returns 402 + # insufficient_credits. sig do params( has_next_page: T::Boolean, diff --git a/rbi/x_twitter_scraper/models/search_tweet.rbi b/rbi/x_twitter_scraper/models/search_tweet.rbi index 8af0d86..6cb903c 100644 --- a/rbi/x_twitter_scraper/models/search_tweet.rbi +++ b/rbi/x_twitter_scraper/models/search_tweet.rbi @@ -39,6 +39,15 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :view_count + # Article metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::Article)) } + attr_reader :article + + sig do + params(article: XTwitterScraper::SearchTweet::Article::OrHash).void + end + attr_writer :article + # X user profile with bio, follower counts, and verification status. sig { returns(T.nilable(XTwitterScraper::UserProfile)) } attr_reader :author @@ -46,6 +55,24 @@ module XTwitterScraper sig { params(author: XTwitterScraper::UserProfile::OrHash).void } attr_writer :author + # Public card metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::Card)) } + attr_reader :card + + sig { params(card: XTwitterScraper::SearchTweet::Card::OrHash).void } + attr_writer :card + + # Community Note presentation metadata returned by X. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::CommunityNote)) } + attr_reader :community_note + + sig do + params( + community_note: XTwitterScraper::SearchTweet::CommunityNote::OrHash + ).void + end + attr_writer :community_note + # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) } @@ -78,6 +105,13 @@ module XTwitterScraper sig { params(display_text_range: T::Array[Integer]).void } attr_writer :display_text_range + # Edit history metadata returned by X. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::Edit)) } + attr_reader :edit + + sig { params(edit: XTwitterScraper::SearchTweet::Edit::OrHash).void } + attr_writer :edit + # Parsed search-result entities including URLs, mentions, hashtags, and media # markers sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } @@ -135,6 +169,12 @@ module XTwitterScraper sig { params(is_reply: T::Boolean).void } attr_writer :is_reply + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_translatable + + sig { params(is_translatable: T::Boolean).void } + attr_writer :is_translatable + # Search result language code. sig { returns(T.nilable(String)) } attr_reader :lang @@ -149,6 +189,39 @@ module XTwitterScraper sig { params(media: T::Array[XTwitterScraper::TweetMedia::OrHash]).void } attr_writer :media + # Complete Note Tweet content and rich-text metadata. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::NoteTweet)) } + attr_reader :note_tweet + + sig do + params(note_tweet: XTwitterScraper::SearchTweet::NoteTweet::OrHash).void + end + attr_writer :note_tweet + + # Public place metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::Place)) } + attr_reader :place + + sig { params(place: XTwitterScraper::SearchTweet::Place::OrHash).void } + attr_writer :place + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :possibly_sensitive + + sig { params(possibly_sensitive: T::Boolean).void } + attr_writer :possibly_sensitive + + # Engagement counts retained from a prior tweet edit. + sig { returns(T.nilable(XTwitterScraper::SearchTweet::PreviousCounts)) } + attr_reader :previous_counts + + sig do + params( + previous_counts: XTwitterScraper::SearchTweet::PreviousCounts::OrHash + ).void + end + attr_writer :previous_counts + # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, # media, and conversation fields appear when available. @@ -189,6 +262,12 @@ module XTwitterScraper sig { params(url: String).void } attr_writer :url + sig { returns(T.nilable(String)) } + attr_reader :view_state + + sig { params(view_state: String).void } + attr_writer :view_state + # Tweet returned from search results with inline author info. A zero metric can # mean X did not report the count. sig do @@ -201,11 +280,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::SearchTweet::Article::OrHash, author: XTwitterScraper::UserProfile::OrHash, + card: XTwitterScraper::SearchTweet::Card::OrHash, + community_note: XTwitterScraper::SearchTweet::CommunityNote::OrHash, content_disclosure: XTwitterScraper::ContentDisclosure::OrHash, conversation_id: String, created_at: String, display_text_range: T::Array[Integer], + edit: XTwitterScraper::SearchTweet::Edit::OrHash, entities: T::Hash[Symbol, T.anything], in_reply_to_id: String, in_reply_to_user_id: String, @@ -214,13 +297,19 @@ module XTwitterScraper is_note_tweet: T::Boolean, is_quote_status: T::Boolean, is_reply: T::Boolean, + is_translatable: T::Boolean, lang: String, media: T::Array[XTwitterScraper::TweetMedia::OrHash], + note_tweet: XTwitterScraper::SearchTweet::NoteTweet::OrHash, + place: XTwitterScraper::SearchTweet::Place::OrHash, + possibly_sensitive: T::Boolean, + previous_counts: XTwitterScraper::SearchTweet::PreviousCounts::OrHash, quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, source: String, type: String, - url: String + url: String, + view_state: String ).returns(T.attached_class) end def self.new( @@ -232,8 +321,14 @@ module XTwitterScraper retweet_count:, text:, view_count:, + # Article metadata attached to a tweet. + article: nil, # X user profile with bio, follower counts, and verification status. author: nil, + # Public card metadata attached to a tweet. + card: nil, + # Community Note presentation metadata returned by X. + community_note: nil, # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. content_disclosure: nil, @@ -242,6 +337,8 @@ module XTwitterScraper created_at: nil, # Rendered text's start and end offsets. display_text_range: nil, + # Edit history metadata returned by X. + edit: nil, # Parsed search-result entities including URLs, mentions, hashtags, and media # markers entities: nil, @@ -259,10 +356,18 @@ module XTwitterScraper is_quote_status: nil, # True when this search result is a reply is_reply: nil, + is_translatable: nil, # Search result language code. lang: nil, # Search-result media attachments, omitted when no media is present media: nil, + # Complete Note Tweet content and rich-text metadata. + note_tweet: nil, + # Public place metadata attached to a tweet. + place: nil, + possibly_sensitive: nil, + # Engagement counts retained from a prior tweet edit. + previous_counts: nil, # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, # media, and conversation fields appear when available. @@ -275,7 +380,8 @@ module XTwitterScraper source: nil, type: nil, # Search result permalink. - url: nil + url: nil, + view_state: nil ) end @@ -290,11 +396,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::SearchTweet::Article, author: XTwitterScraper::UserProfile, + card: XTwitterScraper::SearchTweet::Card, + community_note: XTwitterScraper::SearchTweet::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: T::Array[Integer], + edit: XTwitterScraper::SearchTweet::Edit, entities: T::Hash[Symbol, T.anything], in_reply_to_id: String, in_reply_to_user_id: String, @@ -303,18 +413,579 @@ module XTwitterScraper is_note_tweet: T::Boolean, is_quote_status: T::Boolean, is_reply: T::Boolean, + is_translatable: T::Boolean, lang: String, media: T::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::SearchTweet::NoteTweet, + place: XTwitterScraper::SearchTweet::Place, + possibly_sensitive: T::Boolean, + previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, quoted_tweet: XTwitterScraper::EmbeddedTweet, retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } ) end def to_hash end + + class Article < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::Article, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :cover_media_url + + sig { params(cover_media_url: String).void } + attr_writer :cover_media_url + + sig { returns(T.nilable(String)) } + attr_reader :preview_text + + sig { params(preview_text: String).void } + attr_writer :preview_text + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # Article metadata attached to a tweet. + sig do + params( + id: String, + cover_media_url: String, + preview_text: String, + title: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + cover_media_url: nil, + preview_text: nil, + title: nil + ) + end + + sig do + override.returns( + { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + ) + end + def to_hash + end + end + + class Card < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::Card, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :binding_values + + sig { params(binding_values: T::Hash[Symbol, T.anything]).void } + attr_writer :binding_values + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Public card metadata attached to a tweet. + sig do + params( + id: String, + binding_values: T::Hash[Symbol, T.anything], + name: String, + url: String + ).returns(T.attached_class) + end + def self.new(id: nil, binding_values: nil, name: nil, url: nil) + end + + sig do + override.returns( + { + id: String, + binding_values: T::Hash[Symbol, T.anything], + name: String, + url: String + } + ) + end + def to_hash + end + end + + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::CommunityNote, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :destination_url + + sig { params(destination_url: String).void } + attr_writer :destination_url + + sig { returns(T.nilable(String)) } + attr_reader :footer + + sig { params(footer: String).void } + attr_writer :footer + + sig { returns(T.nilable(String)) } + attr_reader :short_title + + sig { params(short_title: String).void } + attr_writer :short_title + + sig { returns(T.nilable(String)) } + attr_reader :subtitle + + sig { params(subtitle: String).void } + attr_writer :subtitle + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + sig { returns(T.nilable(String)) } + attr_reader :visual_style + + sig { params(visual_style: String).void } + attr_writer :visual_style + + # Community Note presentation metadata returned by X. + sig do + params( + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + destination_url: nil, + footer: nil, + short_title: nil, + subtitle: nil, + title: nil, + visual_style: nil + ) + end + + sig do + override.returns( + { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + ) + end + def to_hash + end + end + + class Edit < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::Edit, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :editable_until_msecs + + sig { params(editable_until_msecs: String).void } + attr_writer :editable_until_msecs + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :edit_tweet_ids + + sig { params(edit_tweet_ids: T::Array[String]).void } + attr_writer :edit_tweet_ids + + # Edit history metadata returned by X. + sig do + params( + editable_until_msecs: String, + edit_tweet_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new(editable_until_msecs: nil, edit_tweet_ids: nil) + end + + sig do + override.returns( + { editable_until_msecs: String, edit_tweet_ids: T::Array[String] } + ) + end + def to_hash + end + end + + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::NoteTweet, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :text + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :entities + + sig { params(entities: T::Hash[Symbol, T.anything]).void } + attr_writer :entities + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_expandable + + sig { params(is_expandable: T::Boolean).void } + attr_writer :is_expandable + + sig do + returns( + T.nilable( + T::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + ) + ) + end + attr_reader :richtext_tags + + sig do + params( + richtext_tags: + T::Array[ + XTwitterScraper::SearchTweet::NoteTweet::RichtextTag::OrHash + ] + ).void + end + attr_writer :richtext_tags + + # Complete Note Tweet content and rich-text metadata. + sig do + params( + text: String, + id: String, + entities: T::Hash[Symbol, T.anything], + is_expandable: T::Boolean, + richtext_tags: + T::Array[ + XTwitterScraper::SearchTweet::NoteTweet::RichtextTag::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + text:, + id: nil, + entities: nil, + is_expandable: nil, + richtext_tags: nil + ) + end + + sig do + override.returns( + { + text: String, + id: String, + entities: T::Hash[Symbol, T.anything], + is_expandable: T::Boolean, + richtext_tags: + T::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + } + ) + end + def to_hash + end + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::NoteTweet::RichtextTag, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :from_index + + sig { returns(Integer) } + attr_accessor :to_index + + sig { returns(T::Array[String]) } + attr_accessor :types + + sig do + params( + from_index: Integer, + to_index: Integer, + types: T::Array[String] + ).returns(T.attached_class) + end + def self.new(from_index:, to_index:, types:) + end + + sig do + override.returns( + { + from_index: Integer, + to_index: Integer, + types: T::Array[String] + } + ) + end + def to_hash + end + end + end + + class Place < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::Place, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :bounding_box + + sig { params(bounding_box: T::Hash[Symbol, T.anything]).void } + attr_writer :bounding_box + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :country_code + + sig { params(country_code: String).void } + attr_writer :country_code + + sig { returns(T.nilable(String)) } + attr_reader :full_name + + sig { params(full_name: String).void } + attr_writer :full_name + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :place_type + + sig { params(place_type: String).void } + attr_writer :place_type + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Public place metadata attached to a tweet. + sig do + params( + id: String, + bounding_box: T::Hash[Symbol, T.anything], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + bounding_box: nil, + country: nil, + country_code: nil, + full_name: nil, + name: nil, + place_type: nil, + url: nil + ) + end + + sig do + override.returns( + { + id: String, + bounding_box: T::Hash[Symbol, T.anything], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + ) + end + def to_hash + end + end + + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::SearchTweet::PreviousCounts, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_reader :bookmark_count + + sig { params(bookmark_count: Integer).void } + attr_writer :bookmark_count + + sig { returns(T.nilable(Integer)) } + attr_reader :like_count + + sig { params(like_count: Integer).void } + attr_writer :like_count + + sig { returns(T.nilable(Integer)) } + attr_reader :quote_count + + sig { params(quote_count: Integer).void } + attr_writer :quote_count + + sig { returns(T.nilable(Integer)) } + attr_reader :reply_count + + sig { params(reply_count: Integer).void } + attr_writer :reply_count + + sig { returns(T.nilable(Integer)) } + attr_reader :retweet_count + + sig { params(retweet_count: Integer).void } + attr_writer :retweet_count + + # Engagement counts retained from a prior tweet edit. + sig do + params( + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + ).returns(T.attached_class) + end + def self.new( + bookmark_count: nil, + like_count: nil, + quote_count: nil, + reply_count: nil, + retweet_count: nil + ) + end + + sig do + override.returns( + { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + ) + end + def to_hash + end + end end end end diff --git a/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi index d154a2d..6684f3a 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi @@ -18,24 +18,12 @@ module XTwitterScraper sig do returns( - T.nilable( - T::Array[ - XTwitterScraper::Models::Support::TicketListResponse::Ticket - ] - ) + T::Array[ + XTwitterScraper::Models::Support::TicketListResponse::Ticket + ] ) end - attr_reader :tickets - - sig do - params( - tickets: - T::Array[ - XTwitterScraper::Models::Support::TicketListResponse::Ticket::OrHash - ] - ).void - end - attr_writer :tickets + attr_accessor :tickets sig do params( @@ -45,7 +33,7 @@ module XTwitterScraper ] ).returns(T.attached_class) end - def self.new(tickets: nil) + def self.new(tickets:) end sig do @@ -70,59 +58,46 @@ module XTwitterScraper ) end - sig { returns(T.nilable(Time)) } - attr_reader :created_at - - sig { params(created_at: Time).void } - attr_writer :created_at - - sig { returns(T.nilable(Integer)) } - attr_reader :message_count - - sig { params(message_count: Integer).void } - attr_writer :message_count - - sig { returns(T.nilable(String)) } - attr_reader :public_id - - sig { params(public_id: String).void } - attr_writer :public_id + sig { returns(Time) } + attr_accessor :created_at - sig { returns(T.nilable(String)) } - attr_reader :status + sig { returns(Integer) } + attr_accessor :message_count - sig { params(status: String).void } - attr_writer :status + sig { returns(String) } + attr_accessor :public_id - sig { returns(T.nilable(String)) } - attr_reader :subject - - sig { params(subject: String).void } - attr_writer :subject + sig do + returns( + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol + ) + end + attr_accessor :status - sig { returns(T.nilable(Time)) } - attr_reader :updated_at + sig { returns(String) } + attr_accessor :subject - sig { params(updated_at: Time).void } - attr_writer :updated_at + sig { returns(Time) } + attr_accessor :updated_at sig do params( created_at: Time, message_count: Integer, public_id: String, - status: String, + status: + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::OrSymbol, subject: String, updated_at: Time ).returns(T.attached_class) end def self.new( - created_at: nil, - message_count: nil, - public_id: nil, - status: nil, - subject: nil, - updated_at: nil + created_at:, + message_count:, + public_id:, + status:, + subject:, + updated_at: ) end @@ -132,7 +107,8 @@ module XTwitterScraper created_at: Time, message_count: Integer, public_id: String, - status: String, + status: + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol, subject: String, updated_at: Time } @@ -140,6 +116,50 @@ module XTwitterScraper end def to_hash end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketListResponse::Ticket::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi index 338bf66..b063bc0 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi @@ -16,56 +16,33 @@ module XTwitterScraper ) end - sig { returns(T.nilable(Time)) } - attr_reader :created_at - - sig { params(created_at: Time).void } - attr_writer :created_at + sig { returns(Time) } + attr_accessor :created_at sig do returns( - T.nilable( - T::Array[ - XTwitterScraper::Models::Support::TicketRetrieveResponse::Message - ] - ) + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message + ] ) end - attr_reader :messages + attr_accessor :messages + + sig { returns(String) } + attr_accessor :public_id sig do - params( - messages: - T::Array[ - XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::OrHash - ] - ).void + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol + ) end - attr_writer :messages - - sig { returns(T.nilable(String)) } - attr_reader :public_id - - sig { params(public_id: String).void } - attr_writer :public_id - - sig { returns(T.nilable(String)) } - attr_reader :status + attr_accessor :status - sig { params(status: String).void } - attr_writer :status + sig { returns(String) } + attr_accessor :subject - sig { returns(T.nilable(String)) } - attr_reader :subject - - sig { params(subject: String).void } - attr_writer :subject - - sig { returns(T.nilable(Time)) } - attr_reader :updated_at - - sig { params(updated_at: Time).void } - attr_writer :updated_at + sig { returns(Time) } + attr_accessor :updated_at sig do params( @@ -75,18 +52,19 @@ module XTwitterScraper XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::OrHash ], public_id: String, - status: String, + status: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::OrSymbol, subject: String, updated_at: Time ).returns(T.attached_class) end def self.new( - created_at: nil, - messages: nil, - public_id: nil, - status: nil, - subject: nil, - updated_at: nil + created_at:, + messages:, + public_id:, + status:, + subject:, + updated_at: ) end @@ -99,7 +77,8 @@ module XTwitterScraper XTwitterScraper::Models::Support::TicketRetrieveResponse::Message ], public_id: String, - status: String, + status: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol, subject: String, updated_at: Time } @@ -119,42 +98,25 @@ module XTwitterScraper sig do returns( - T.nilable( - T::Array[ - XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment - ] - ) + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment + ] ) end - attr_reader :attachments + attr_accessor :attachments - sig do - params( - attachments: - T::Array[ - XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::OrHash - ] - ).void - end - attr_writer :attachments - - sig { returns(T.nilable(String)) } - attr_reader :body - - sig { params(body: String).void } - attr_writer :body - - sig { returns(T.nilable(Time)) } - attr_reader :created_at - - sig { params(created_at: Time).void } - attr_writer :created_at + sig { returns(String) } + attr_accessor :body - sig { returns(T.nilable(String)) } - attr_reader :sender + sig { returns(Time) } + attr_accessor :created_at - sig { params(sender: String).void } - attr_writer :sender + sig do + returns( + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::TaggedSymbol + ) + end + attr_accessor :sender sig do params( @@ -164,15 +126,11 @@ module XTwitterScraper ], body: String, created_at: Time, - sender: String + sender: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::OrSymbol ).returns(T.attached_class) end - def self.new( - attachments: nil, - body: nil, - created_at: nil, - sender: nil - ) + def self.new(attachments:, body:, created_at:, sender:) end sig do @@ -184,7 +142,8 @@ module XTwitterScraper ], body: String, created_at: Time, - sender: String + sender: + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::TaggedSymbol } ) end @@ -419,6 +378,89 @@ module XTwitterScraper end end end + + module Sender + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::TaggedSymbol + ) + SUPPORT = + T.let( + :support, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::TaggedSymbol + ) + SYSTEM = + T.let( + :system, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Sender::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketRetrieveResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end end end end diff --git a/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi b/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi index 425d58c..dd3222e 100644 --- a/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi +++ b/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi @@ -16,27 +16,76 @@ module XTwitterScraper ) end - sig { returns(T.nilable(String)) } - attr_reader :public_id + sig { returns(String) } + attr_accessor :public_id - sig { params(public_id: String).void } - attr_writer :public_id - - sig { returns(T.nilable(String)) } - attr_reader :status - - sig { params(status: String).void } - attr_writer :status + sig do + returns( + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status sig do - params(public_id: String, status: String).returns(T.attached_class) + params( + public_id: String, + status: + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::OrSymbol + ).returns(T.attached_class) end - def self.new(public_id: nil, status: nil) + def self.new(public_id:, status:) end - sig { override.returns({ public_id: String, status: String }) } + sig do + override.returns( + { + public_id: String, + status: + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::TaggedSymbol + } + ) + end def to_hash end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::Support::TicketUpdateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :open, + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::TaggedSymbol + ) + RESOLVED = + T.let( + :resolved, + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::TaggedSymbol + ) + CLOSED = + T.let( + :closed, + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::Support::TicketUpdateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end end end diff --git a/rbi/x_twitter_scraper/models/trend_list_response.rbi b/rbi/x_twitter_scraper/models/trend_list_response.rbi index f9dfdf8..a60580a 100644 --- a/rbi/x_twitter_scraper/models/trend_list_response.rbi +++ b/rbi/x_twitter_scraper/models/trend_list_response.rbi @@ -67,6 +67,10 @@ module XTwitterScraper sig { params(description: String).void } attr_writer :description + # Promotion identifier from X. Null for organic trends. + sig { returns(T.nilable(String)) } + attr_accessor :promoted_content + sig { returns(T.nilable(String)) } attr_reader :query @@ -79,20 +83,53 @@ module XTwitterScraper sig { params(rank: Integer).void } attr_writer :rank + # Approximate public post volume when X supplies it. + sig { returns(T.nilable(Integer)) } + attr_accessor :tweet_volume + + # X search URL for the trend. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + sig do params( name: String, description: String, + promoted_content: T.nilable(String), query: String, - rank: Integer + rank: Integer, + tweet_volume: T.nilable(Integer), + url: String ).returns(T.attached_class) end - def self.new(name:, description: nil, query: nil, rank: nil) + def self.new( + name:, + description: nil, + # Promotion identifier from X. Null for organic trends. + promoted_content: nil, + query: nil, + rank: nil, + # Approximate public post volume when X supplies it. + tweet_volume: nil, + # X search URL for the trend. + url: nil + ) end sig do override.returns( - { name: String, description: String, query: String, rank: Integer } + { + name: String, + description: String, + promoted_content: T.nilable(String), + query: String, + rank: Integer, + tweet_volume: T.nilable(Integer), + url: String + } ) end def to_hash diff --git a/rbi/x_twitter_scraper/models/tweet_media.rbi b/rbi/x_twitter_scraper/models/tweet_media.rbi index 3ac3d7a..9ae69a1 100644 --- a/rbi/x_twitter_scraper/models/tweet_media.rbi +++ b/rbi/x_twitter_scraper/models/tweet_media.rbi @@ -23,6 +23,137 @@ module XTwitterScraper sig { returns(String) } attr_accessor :url + # X media entity ID. + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Whether X permits direct media download. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :allow_download + + sig { params(allow_download: T::Boolean).void } + attr_writer :allow_download + + # Accessibility text supplied for the media. + sig { returns(T.nilable(String)) } + attr_reader :alt_text + + sig { params(alt_text: String).void } + attr_writer :alt_text + + # Video aspect ratio as width and height. + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :aspect_ratio + + sig { params(aspect_ratio: T::Array[Integer]).void } + attr_writer :aspect_ratio + + # Media availability state reported by X. + sig { returns(T.nilable(String)) } + attr_reader :availability_status + + sig { params(availability_status: String).void } + attr_writer :availability_status + + # Display-friendly media URL reported by X. + sig { returns(T.nilable(String)) } + attr_reader :display_url + + sig { params(display_url: String).void } + attr_writer :display_url + + # Video duration in milliseconds. + sig { returns(T.nilable(Integer)) } + attr_reader :duration_millis + + sig { params(duration_millis: Integer).void } + attr_writer :duration_millis + + # Expanded X media URL. + sig { returns(T.nilable(String)) } + attr_reader :expanded_url + + sig { params(expanded_url: String).void } + attr_writer :expanded_url + + # Face-aware crop rectangles grouped by media size. + sig do + returns( + T.nilable( + T::Hash[Symbol, T::Array[XTwitterScraper::TweetMedia::FaceRect]] + ) + ) + end + attr_reader :face_rects + + sig do + params( + face_rects: + T::Hash[ + Symbol, + T::Array[XTwitterScraper::TweetMedia::FaceRect::OrHash] + ] + ).void + end + attr_writer :face_rects + + # Suggested image crops reported by X. + sig do + returns(T.nilable(T::Array[XTwitterScraper::TweetMedia::FocusRect])) + end + attr_reader :focus_rects + + sig do + params( + focus_rects: T::Array[XTwitterScraper::TweetMedia::FocusRect::OrHash] + ).void + end + attr_writer :focus_rects + + # Original media height. + sig { returns(T.nilable(Integer)) } + attr_reader :height + + sig { params(height: Integer).void } + attr_writer :height + + # Media entity offsets in the tweet text. + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :indices + + sig { params(indices: T::Array[Integer]).void } + attr_writer :indices + + # Stable X media key. + sig { returns(T.nilable(String)) } + attr_reader :media_key + + sig { params(media_key: String).void } + attr_writer :media_key + + # Whether X reports the media as monetizable. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :monetizable + + sig { params(monetizable: T::Boolean).void } + attr_writer :monetizable + + # Named media renditions and resize modes. + sig do + returns(T.nilable(T::Hash[Symbol, XTwitterScraper::TweetMedia::Size])) + end + attr_reader :sizes + + sig do + params( + sizes: T::Hash[Symbol, XTwitterScraper::TweetMedia::Size::OrHash] + ).void + end + attr_writer :sizes + # Available video encodings, ordered as returned sig do returns(T.nilable(T::Array[XTwitterScraper::TweetMedia::VideoVariant])) @@ -37,14 +168,41 @@ module XTwitterScraper end attr_writer :video_variants + # Original media width. + sig { returns(T.nilable(Integer)) } + attr_reader :width + + sig { params(width: Integer).void } + attr_writer :width + # Normalized media attached to a tweet. sig do params( media_url: String, type: XTwitterScraper::TweetMedia::Type::OrSymbol, url: String, + id: String, + allow_download: T::Boolean, + alt_text: String, + aspect_ratio: T::Array[Integer], + availability_status: String, + display_url: String, + duration_millis: Integer, + expanded_url: String, + face_rects: + T::Hash[ + Symbol, + T::Array[XTwitterScraper::TweetMedia::FaceRect::OrHash] + ], + focus_rects: T::Array[XTwitterScraper::TweetMedia::FocusRect::OrHash], + height: Integer, + indices: T::Array[Integer], + media_key: String, + monetizable: T::Boolean, + sizes: T::Hash[Symbol, XTwitterScraper::TweetMedia::Size::OrHash], video_variants: - T::Array[XTwitterScraper::TweetMedia::VideoVariant::OrHash] + T::Array[XTwitterScraper::TweetMedia::VideoVariant::OrHash], + width: Integer ).returns(T.attached_class) end def self.new( @@ -53,8 +211,40 @@ module XTwitterScraper type:, # X media link from the tweet url:, + # X media entity ID. + id: nil, + # Whether X permits direct media download. + allow_download: nil, + # Accessibility text supplied for the media. + alt_text: nil, + # Video aspect ratio as width and height. + aspect_ratio: nil, + # Media availability state reported by X. + availability_status: nil, + # Display-friendly media URL reported by X. + display_url: nil, + # Video duration in milliseconds. + duration_millis: nil, + # Expanded X media URL. + expanded_url: nil, + # Face-aware crop rectangles grouped by media size. + face_rects: nil, + # Suggested image crops reported by X. + focus_rects: nil, + # Original media height. + height: nil, + # Media entity offsets in the tweet text. + indices: nil, + # Stable X media key. + media_key: nil, + # Whether X reports the media as monetizable. + monetizable: nil, + # Named media renditions and resize modes. + sizes: nil, # Available video encodings, ordered as returned - video_variants: nil + video_variants: nil, + # Original media width. + width: nil ) end @@ -64,7 +254,24 @@ module XTwitterScraper media_url: String, type: XTwitterScraper::TweetMedia::Type::TaggedSymbol, url: String, - video_variants: T::Array[XTwitterScraper::TweetMedia::VideoVariant] + id: String, + allow_download: T::Boolean, + alt_text: String, + aspect_ratio: T::Array[Integer], + availability_status: String, + display_url: String, + duration_millis: Integer, + expanded_url: String, + face_rects: + T::Hash[Symbol, T::Array[XTwitterScraper::TweetMedia::FaceRect]], + focus_rects: T::Array[XTwitterScraper::TweetMedia::FocusRect], + height: Integer, + indices: T::Array[Integer], + media_key: String, + monetizable: T::Boolean, + sizes: T::Hash[Symbol, XTwitterScraper::TweetMedia::Size], + video_variants: T::Array[XTwitterScraper::TweetMedia::VideoVariant], + width: Integer } ) end @@ -92,6 +299,109 @@ module XTwitterScraper end end + class FaceRect < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::TweetMedia::FaceRect, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :h + + sig { returns(Integer) } + attr_accessor :w + + sig { returns(Integer) } + attr_accessor :x + + sig { returns(Integer) } + attr_accessor :y_ + + sig do + params(h: Integer, w: Integer, x: Integer, y_: Integer).returns( + T.attached_class + ) + end + def self.new(h:, w:, x:, y_:) + end + + sig do + override.returns({ h: Integer, w: Integer, x: Integer, y_: Integer }) + end + def to_hash + end + end + + class FocusRect < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::TweetMedia::FocusRect, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :h + + sig { returns(Integer) } + attr_accessor :w + + sig { returns(Integer) } + attr_accessor :x + + sig { returns(Integer) } + attr_accessor :y_ + + sig do + params(h: Integer, w: Integer, x: Integer, y_: Integer).returns( + T.attached_class + ) + end + def self.new(h:, w:, x:, y_:) + end + + sig do + override.returns({ h: Integer, w: Integer, x: Integer, y_: Integer }) + end + def to_hash + end + end + + class Size < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::TweetMedia::Size, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :h + + sig { returns(String) } + attr_accessor :resize + + sig { returns(Integer) } + attr_accessor :w + + sig do + params(h: Integer, resize: String, w: Integer).returns( + T.attached_class + ) + end + def self.new(h:, resize:, w:) + end + + sig { override.returns({ h: Integer, resize: String, w: Integer }) } + def to_hash + end + end + class VideoVariant < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do diff --git a/rbi/x_twitter_scraper/models/user_profile.rbi b/rbi/x_twitter_scraper/models/user_profile.rbi index 87b7a8d..9a21629 100644 --- a/rbi/x_twitter_scraper/models/user_profile.rbi +++ b/rbi/x_twitter_scraper/models/user_profile.rbi @@ -24,17 +24,33 @@ module XTwitterScraper sig { returns(String) } attr_accessor :username + # Organization affiliation label shown on an X profile. + sig do + returns( + T.nilable(XTwitterScraper::UserProfile::AffiliatesHighlightedLabel) + ) + end + attr_reader :affiliates_highlighted_label + + sig do + params( + affiliates_highlighted_label: + XTwitterScraper::UserProfile::AffiliatesHighlightedLabel::OrHash + ).void + end + attr_writer :affiliates_highlighted_label + sig { returns(T.nilable(String)) } attr_reader :automated_by sig { params(automated_by: String).void } attr_writer :automated_by - sig { returns(T.nilable(T::Boolean)) } - attr_reader :can_dm + sig { returns(T.nilable(Integer)) } + attr_reader :business_account_affiliates_count - sig { params(can_dm: T::Boolean).void } - attr_writer :can_dm + sig { params(business_account_affiliates_count: Integer).void } + attr_writer :business_account_affiliates_count # Community role when returned by community member reads sig { returns(T.nilable(String)) } @@ -55,6 +71,12 @@ module XTwitterScraper sig { params(created_at: String).void } attr_writer :created_at + sig { returns(T.nilable(Integer)) } + attr_reader :creator_subscriptions_count + + sig { params(creator_subscriptions_count: Integer).void } + attr_writer :creator_subscriptions_count + sig { returns(T.nilable(String)) } attr_reader :description @@ -85,6 +107,43 @@ module XTwitterScraper sig { params(has_custom_timelines: T::Boolean).void } attr_writer :has_custom_timelines + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_graduated_access + + sig { params(has_graduated_access: T::Boolean).void } + attr_writer :has_graduated_access + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_hidden_subscriptions_on_profile + + sig { params(has_hidden_subscriptions_on_profile: T::Boolean).void } + attr_writer :has_hidden_subscriptions_on_profile + + # Profile highlight availability and count metadata. + sig { returns(T.nilable(XTwitterScraper::UserProfile::HighlightsInfo)) } + attr_reader :highlights_info + + sig do + params( + highlights_info: XTwitterScraper::UserProfile::HighlightsInfo::OrHash + ).void + end + attr_writer :highlights_info + + # Identity verification metadata displayed by X. + sig do + returns(T.nilable(XTwitterScraper::UserProfile::IdentityVerification)) + end + attr_reader :identity_verification + + sig do + params( + identity_verification: + XTwitterScraper::UserProfile::IdentityVerification::OrHash + ).void + end + attr_writer :identity_verification + sig { returns(T.nilable(T::Boolean)) } attr_reader :is_automated @@ -98,6 +157,12 @@ module XTwitterScraper sig { params(is_blue_verified: T::Boolean).void } attr_writer :is_blue_verified + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_profile_translatable + + sig { params(is_profile_translatable: T::Boolean).void } + attr_writer :is_profile_translatable + sig { returns(T.nilable(T::Boolean)) } attr_reader :is_translator @@ -123,6 +188,12 @@ module XTwitterScraper sig { params(media_count: Integer).void } attr_writer :media_count + sig { returns(T.nilable(String)) } + attr_reader :parody_commentary_fan_label + + sig { params(parody_commentary_fan_label: String).void } + attr_writer :parody_commentary_fan_label + sig { returns(T.nilable(T::Array[String])) } attr_reader :pinned_tweet_ids @@ -149,12 +220,42 @@ module XTwitterScraper sig { params(profile_banner_url: String).void } attr_writer :profile_banner_url + sig { returns(T.nilable(String)) } + attr_reader :profile_description_language + + sig { params(profile_description_language: String).void } + attr_writer :profile_description_language + + sig { returns(T.nilable(String)) } + attr_reader :profile_image_shape + + sig { params(profile_image_shape: String).void } + attr_writer :profile_image_shape + + sig { returns(T.nilable(String)) } + attr_reader :profile_interstitial_type + + sig { params(profile_interstitial_type: String).void } + attr_writer :profile_interstitial_type + sig { returns(T.nilable(String)) } attr_reader :profile_picture sig { params(profile_picture: String).void } attr_writer :profile_picture + sig { returns(T.nilable(T::Boolean)) } + attr_reader :profile_sort_enabled + + sig { params(profile_sort_enabled: T::Boolean).void } + attr_writer :profile_sort_enabled + + sig { returns(T.nilable(String)) } + attr_reader :profile_translator_type + + sig { params(profile_translator_type: String).void } + attr_writer :profile_translator_type + # Whether the profile protects its posts sig { returns(T.nilable(T::Boolean)) } attr_reader :protected @@ -168,6 +269,12 @@ module XTwitterScraper sig { params(statuses_count: Integer).void } attr_writer :statuses_count + sig { returns(T.nilable(T::Boolean)) } + attr_reader :super_follow_eligible + + sig { params(super_follow_eligible: T::Boolean).void } + attr_writer :super_follow_eligible + sig { returns(T.nilable(T::Boolean)) } attr_reader :unavailable @@ -198,20 +305,6 @@ module XTwitterScraper sig { params(verified_type: String).void } attr_writer :verified_type - # Whether this profile follows the authenticated viewer - sig { returns(T.nilable(T::Boolean)) } - attr_reader :viewer_followed_by - - sig { params(viewer_followed_by: T::Boolean).void } - attr_writer :viewer_followed_by - - # Whether the authenticated viewer follows this profile - sig { returns(T.nilable(T::Boolean)) } - attr_reader :viewer_following - - sig { params(viewer_following: T::Boolean).void } - attr_writer :viewer_following - sig { returns(T.nilable(T::Array[String])) } attr_reader :withheld_in_countries @@ -224,36 +317,50 @@ module XTwitterScraper id: String, name: String, username: String, + affiliates_highlighted_label: + XTwitterScraper::UserProfile::AffiliatesHighlightedLabel::OrHash, automated_by: String, - can_dm: T::Boolean, + business_account_affiliates_count: Integer, community_role: String, cover_picture: String, created_at: String, + creator_subscriptions_count: Integer, description: String, favourites_count: Integer, followers: Integer, following: Integer, has_custom_timelines: T::Boolean, + has_graduated_access: T::Boolean, + has_hidden_subscriptions_on_profile: T::Boolean, + highlights_info: XTwitterScraper::UserProfile::HighlightsInfo::OrHash, + identity_verification: + XTwitterScraper::UserProfile::IdentityVerification::OrHash, is_automated: T::Boolean, is_blue_verified: T::Boolean, + is_profile_translatable: T::Boolean, is_translator: T::Boolean, is_verified: T::Boolean, location: String, media_count: Integer, + parody_commentary_fan_label: String, pinned_tweet_ids: T::Array[String], possibly_sensitive: T::Boolean, profile_bio: T::Hash[Symbol, T.anything], profile_banner_url: String, + profile_description_language: String, + profile_image_shape: String, + profile_interstitial_type: String, profile_picture: String, + profile_sort_enabled: T::Boolean, + profile_translator_type: String, protected: T::Boolean, statuses_count: Integer, + super_follow_eligible: T::Boolean, unavailable: T::Boolean, unavailable_reason: String, url: String, verified: T::Boolean, verified_type: String, - viewer_followed_by: T::Boolean, - viewer_following: T::Boolean, withheld_in_countries: T::Array[String] ).returns(T.attached_class) end @@ -261,44 +368,57 @@ module XTwitterScraper id:, name:, username:, + # Organization affiliation label shown on an X profile. + affiliates_highlighted_label: nil, automated_by: nil, - can_dm: nil, + business_account_affiliates_count: nil, # Community role when returned by community member reads community_role: nil, cover_picture: nil, created_at: nil, + creator_subscriptions_count: nil, description: nil, favourites_count: nil, followers: nil, following: nil, has_custom_timelines: nil, + has_graduated_access: nil, + has_hidden_subscriptions_on_profile: nil, + # Profile highlight availability and count metadata. + highlights_info: nil, + # Identity verification metadata displayed by X. + identity_verification: nil, is_automated: nil, # Whether X shows a blue verification badge is_blue_verified: nil, + is_profile_translatable: nil, is_translator: nil, # Whether X marks the profile as verified is_verified: nil, location: nil, media_count: nil, + parody_commentary_fan_label: nil, pinned_tweet_ids: nil, possibly_sensitive: nil, # Structured profile bio with entity annotations profile_bio: nil, # Original X profile banner field when available profile_banner_url: nil, + profile_description_language: nil, + profile_image_shape: nil, + profile_interstitial_type: nil, profile_picture: nil, + profile_sort_enabled: nil, + profile_translator_type: nil, # Whether the profile protects its posts protected: nil, statuses_count: nil, + super_follow_eligible: nil, unavailable: nil, unavailable_reason: nil, url: nil, verified: nil, verified_type: nil, - # Whether this profile follows the authenticated viewer - viewer_followed_by: nil, - # Whether the authenticated viewer follows this profile - viewer_following: nil, withheld_in_countries: nil ) end @@ -309,42 +429,233 @@ module XTwitterScraper id: String, name: String, username: String, + affiliates_highlighted_label: + XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, automated_by: String, - can_dm: T::Boolean, + business_account_affiliates_count: Integer, community_role: String, cover_picture: String, created_at: String, + creator_subscriptions_count: Integer, description: String, favourites_count: Integer, followers: Integer, following: Integer, has_custom_timelines: T::Boolean, + has_graduated_access: T::Boolean, + has_hidden_subscriptions_on_profile: T::Boolean, + highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, + identity_verification: + XTwitterScraper::UserProfile::IdentityVerification, is_automated: T::Boolean, is_blue_verified: T::Boolean, + is_profile_translatable: T::Boolean, is_translator: T::Boolean, is_verified: T::Boolean, location: String, media_count: Integer, + parody_commentary_fan_label: String, pinned_tweet_ids: T::Array[String], possibly_sensitive: T::Boolean, profile_bio: T::Hash[Symbol, T.anything], profile_banner_url: String, + profile_description_language: String, + profile_image_shape: String, + profile_interstitial_type: String, profile_picture: String, + profile_sort_enabled: T::Boolean, + profile_translator_type: String, protected: T::Boolean, statuses_count: Integer, + super_follow_eligible: T::Boolean, unavailable: T::Boolean, unavailable_reason: String, url: String, verified: T::Boolean, verified_type: String, - viewer_followed_by: T::Boolean, - viewer_following: T::Boolean, withheld_in_countries: T::Array[String] } ) end def to_hash end + + class AffiliatesHighlightedLabel < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :badge_url + + sig { params(badge_url: String).void } + attr_writer :badge_url + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + sig { returns(T.nilable(String)) } + attr_reader :url_type + + sig { params(url_type: String).void } + attr_writer :url_type + + sig { returns(T.nilable(String)) } + attr_reader :user_label_display_type + + sig { params(user_label_display_type: String).void } + attr_writer :user_label_display_type + + sig { returns(T.nilable(String)) } + attr_reader :user_label_type + + sig { params(user_label_type: String).void } + attr_writer :user_label_type + + # Organization affiliation label shown on an X profile. + sig do + params( + badge_url: String, + description: String, + url: String, + url_type: String, + user_label_display_type: String, + user_label_type: String + ).returns(T.attached_class) + end + def self.new( + badge_url: nil, + description: nil, + url: nil, + url_type: nil, + user_label_display_type: nil, + user_label_type: nil + ) + end + + sig do + override.returns( + { + badge_url: String, + description: String, + url: String, + url_type: String, + user_label_display_type: String, + user_label_type: String + } + ) + end + def to_hash + end + end + + class HighlightsInfo < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::UserProfile::HighlightsInfo, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :can_highlight_tweets + + sig { params(can_highlight_tweets: T::Boolean).void } + attr_writer :can_highlight_tweets + + sig { returns(T.nilable(String)) } + attr_reader :highlighted_tweets + + sig { params(highlighted_tweets: String).void } + attr_writer :highlighted_tweets + + # Profile highlight availability and count metadata. + sig do + params( + can_highlight_tweets: T::Boolean, + highlighted_tweets: String + ).returns(T.attached_class) + end + def self.new(can_highlight_tweets: nil, highlighted_tweets: nil) + end + + sig do + override.returns( + { can_highlight_tweets: T::Boolean, highlighted_tweets: String } + ) + end + def to_hash + end + end + + class IdentityVerification < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::UserProfile::IdentityVerification, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_identity_verified + + sig { params(is_identity_verified: T::Boolean).void } + attr_writer :is_identity_verified + + sig { returns(T.nilable(String)) } + attr_reader :verified_since_msec + + sig { params(verified_since_msec: String).void } + attr_writer :verified_since_msec + + # Identity verification metadata displayed by X. + sig do + params( + description: String, + is_identity_verified: T::Boolean, + verified_since_msec: String + ).returns(T.attached_class) + end + def self.new( + description: nil, + is_identity_verified: nil, + verified_since_msec: nil + ) + end + + sig do + override.returns( + { + description: String, + is_identity_verified: T::Boolean, + verified_since_msec: String + } + ) + end + def to_hash + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi index d0c2e17..31becfe 100644 --- a/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi @@ -10,18 +10,18 @@ module XTwitterScraper Variants = T.type_alias do T.any( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode ) end - class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel + class Pending < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending, XTwitterScraper::Internal::AnyHash ) end @@ -69,11 +69,11 @@ module XTwitterScraper end end - class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseModel + class Success < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success, XTwitterScraper::Internal::AnyHash ) end @@ -107,11 +107,11 @@ module XTwitterScraper end end - class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseModel + class Failed < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed, XTwitterScraper::Internal::AnyHash ) end @@ -174,11 +174,11 @@ module XTwitterScraper end end - class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel + class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel OrHash = T.type_alias do T.any( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge, + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode, XTwitterScraper::Internal::AnyHash ) end @@ -192,18 +192,10 @@ module XTwitterScraper sig { returns(String) } attr_accessor :message - sig do - returns( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol - ) - end + sig { returns(Symbol) } attr_accessor :object - sig do - returns( - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol - ) - end + sig { returns(Symbol) } attr_accessor :status sig { returns(String) } @@ -216,14 +208,19 @@ module XTwitterScraper id: String, expires_at: Time, message: String, - object: - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::OrSymbol, - status: - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::OrSymbol, - username: String + username: String, + object: Symbol, + status: Symbol ).returns(T.attached_class) end - def self.new(id:, expires_at:, message:, object:, status:, username:) + def self.new( + id:, + expires_at:, + message:, + username:, + object: :x_account_connection_challenge, + status: :requires_email_code + ) end sig do @@ -232,74 +229,14 @@ module XTwitterScraper id: String, expires_at: Time, message: String, - object: - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol, - status: - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol, + object: Symbol, + status: Symbol, username: String } ) end def to_hash end - - module Object - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - X_ACCOUNT_CONNECTION_CHALLENGE = - T.let( - :x_account_connection_challenge, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Object::TaggedSymbol - ] - ) - end - def self.values - end - end - - module Status - extend XTwitterScraper::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REQUIRES_EMAIL_CODE = - T.let( - :requires_email_code, - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::Status::TaggedSymbol - ] - ) - end - def self.values - end - end end sig do diff --git a/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi b/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi index 2e54cb2..65403c2 100644 --- a/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi @@ -29,7 +29,7 @@ module XTwitterScraper end attr_accessor :health - sig { returns(String) } + sig { returns(Symbol) } attr_accessor :status sig { returns(String) } @@ -45,18 +45,18 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::OrSymbol, - status: String, x_user_id: String, - x_username: String + x_username: String, + status: Symbol ).returns(T.attached_class) end def self.new( id:, created_at:, health:, - status:, x_user_id:, - x_username: + x_username:, + status: :active ) end @@ -67,7 +67,7 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health::TaggedSymbol, - status: String, + status: Symbol, x_user_id: String, x_username: String } diff --git a/rbi/x_twitter_scraper/models/x/account_create_response.rbi b/rbi/x_twitter_scraper/models/x/account_create_response.rbi index b88eef7..859d0a5 100644 --- a/rbi/x_twitter_scraper/models/x/account_create_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_create_response.rbi @@ -7,8 +7,270 @@ module XTwitterScraper module Models module X - AccountCreateResponse = - T.let(T.anything, XTwitterScraper::Internal::Type::Converter) + # Sanitized X account summary returned by connect and reauth. + module AccountCreateResponse + extend XTwitterScraper::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount, + XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending, + XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge + ) + end + + class SanitizedXAccount < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :created_at + + sig do + returns( + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + end + attr_accessor :health + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :x_user_id + + sig { returns(String) } + attr_accessor :x_username + + # Sanitized X account summary returned by connect and reauth. + sig do + params( + id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::OrSymbol, + x_user_id: String, + x_username: String, + status: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + health:, + x_user_id:, + x_username:, + status: :active + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + health: + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol, + status: Symbol, + x_user_id: String, + x_username: String + } + ) + end + def to_hash + end + + module Health + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEALTHY = + T.let( + :healthy, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + LOCKED = + T.let( + :locked, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + NEEDS_REAUTH = + T.let( + :needsReauth, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + RECOVERING = + T.let( + :recovering, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + SUSPENDED = + T.let( + :suspended, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + TEMPORARY_ISSUE = + T.let( + :temporaryIssue, + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::Health::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(Integer) } + attr_accessor :poll_after_ms + + sig { returns(Symbol) } + attr_accessor :status + + # The connection is still in progress. + sig do + params( + id: String, + poll_after_ms: Integer, + object: Symbol, + status: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + poll_after_ms:, + object: :x_account_connection_attempt, + status: :pending + ) + end + + sig do + override.returns( + { + id: String, + object: Symbol, + poll_after_ms: Integer, + status: Symbol + } + ) + end + def to_hash + end + end + + class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Time) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :message + + sig { returns(Symbol) } + attr_accessor :object + + sig { returns(Symbol) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :username + + # Resumable account connection challenge. Submit the email code to finish the same + # connection attempt. + sig do + params( + id: String, + expires_at: Time, + message: String, + username: String, + object: Symbol, + status: Symbol + ).returns(T.attached_class) + end + def self.new( + id:, + expires_at:, + message:, + username:, + object: :x_account_connection_challenge, + status: :requires_email_code + ) + end + + sig do + override.returns( + { + id: String, + expires_at: Time, + message: String, + object: Symbol, + status: Symbol, + username: String + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::AccountCreateResponse::Variants + ] + ) + end + def self.variants + end + end end end end diff --git a/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi b/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi index 1ffb215..5331f98 100644 --- a/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi @@ -29,7 +29,7 @@ module XTwitterScraper end attr_accessor :health - sig { returns(String) } + sig { returns(Symbol) } attr_accessor :status sig { returns(String) } @@ -45,18 +45,18 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::Health::OrSymbol, - status: String, x_user_id: String, - x_username: String + x_username: String, + status: Symbol ).returns(T.attached_class) end def self.new( id:, created_at:, health:, - status:, x_user_id:, - x_username: + x_username:, + status: :active ) end @@ -67,7 +67,7 @@ module XTwitterScraper created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::Health::TaggedSymbol, - status: String, + status: Symbol, x_user_id: String, x_username: String } diff --git a/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi b/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi index 6b4416d..28339c5 100644 --- a/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi +++ b/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi @@ -30,10 +30,8 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -53,10 +51,8 @@ module XTwitterScraper id:, # Pagination cursor for community tweets cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, request_options: {} diff --git a/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi b/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi index b9e7013..d8c4049 100644 --- a/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +++ b/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi @@ -35,10 +35,8 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -82,10 +80,8 @@ module XTwitterScraper q:, # Pagination cursor for community results cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, # Sort order for community results (Latest or Top) diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi index ee5df2d..6d16732 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi @@ -113,13 +113,6 @@ module XTwitterScraper sig { params(invites_policy: String).void } attr_writer :invites_policy - # Whether the authenticated viewer is a member - sig { returns(T.nilable(T::Boolean)) } - attr_reader :is_member - - sig { params(is_member: T::Boolean).void } - attr_writer :is_member - # Whether the community is marked sensitive sig { returns(T.nilable(T::Boolean)) } attr_reader :is_nsfw @@ -173,13 +166,6 @@ module XTwitterScraper end attr_writer :primary_topic - # Authenticated viewer's community role - sig { returns(T.nilable(String)) } - attr_reader :role - - sig { params(role: String).void } - attr_writer :role - # Community rules sig do returns( @@ -212,7 +198,6 @@ module XTwitterScraper XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator::OrHash, description: String, invites_policy: String, - is_member: T::Boolean, is_nsfw: T::Boolean, join_policy: String, member_count: Integer, @@ -220,7 +205,6 @@ module XTwitterScraper name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic::OrHash, - role: String, rules: T::Array[ XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule::OrHash @@ -239,8 +223,6 @@ module XTwitterScraper description: nil, # Invitation policy invites_policy: nil, - # Whether the authenticated viewer is a member - is_member: nil, # Whether the community is marked sensitive is_nsfw: nil, # Join policy (open or restricted) @@ -253,8 +235,6 @@ module XTwitterScraper name: nil, # Primary topic primary_topic: nil, - # Authenticated viewer's community role - role: nil, # Community rules rules: nil ) @@ -270,7 +250,6 @@ module XTwitterScraper XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, description: String, invites_policy: String, - is_member: T::Boolean, is_nsfw: T::Boolean, join_policy: String, member_count: Integer, @@ -278,7 +257,6 @@ module XTwitterScraper name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, - role: String, rules: T::Array[ XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule diff --git a/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi b/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi index 85c2b0c..3527f16 100644 --- a/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +++ b/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi @@ -34,10 +34,8 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -81,10 +79,8 @@ module XTwitterScraper q:, # Pagination cursor for community search cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, # Sort order (Latest or Top) diff --git a/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi b/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi index 6753f2e..86934d0 100644 --- a/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +++ b/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi @@ -36,10 +36,8 @@ module XTwitterScraper sig { params(include_replies: T::Boolean).void } attr_writer :include_replies - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -78,10 +76,8 @@ module XTwitterScraper cursor: nil, # Include replies (default false) include_replies: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, # Unix timestamp - filter after diff --git a/rbi/x_twitter_scraper/models/x/tweet_author.rbi b/rbi/x_twitter_scraper/models/x/tweet_author.rbi index 4d7b488..8c8ab21 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_author.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_author.rbi @@ -16,13 +16,23 @@ module XTwitterScraper ) end + sig { returns(Integer) } + attr_accessor :followers + + sig { returns(T::Boolean) } + attr_accessor :verified + # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. - sig { returns(T.attached_class) } - def self.new + sig do + params(followers: Integer, verified: T::Boolean).returns( + T.attached_class + ) + end + def self.new(followers:, verified:) end - sig { override.returns({}) } + sig { override.returns({ followers: Integer, verified: T::Boolean }) } def to_hash end end diff --git a/rbi/x_twitter_scraper/models/x/tweet_detail.rbi b/rbi/x_twitter_scraper/models/x/tweet_detail.rbi index ded9ab4..264a537 100644 --- a/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +++ b/rbi/x_twitter_scraper/models/x/tweet_detail.rbi @@ -40,6 +40,15 @@ module XTwitterScraper sig { returns(Integer) } attr_accessor :view_count + # Article metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::X::TweetDetail::Article)) } + attr_reader :article + + sig do + params(article: XTwitterScraper::X::TweetDetail::Article::OrHash).void + end + attr_writer :article + # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. sig { returns(T.nilable(XTwitterScraper::X::TweetAuthor)) } @@ -48,6 +57,27 @@ module XTwitterScraper sig { params(author: XTwitterScraper::X::TweetAuthor::OrHash).void } attr_writer :author + # Public card metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::X::TweetDetail::Card)) } + attr_reader :card + + sig { params(card: XTwitterScraper::X::TweetDetail::Card::OrHash).void } + attr_writer :card + + # Community Note presentation metadata returned by X. + sig do + returns(T.nilable(XTwitterScraper::X::TweetDetail::CommunityNote)) + end + attr_reader :community_note + + sig do + params( + community_note: + XTwitterScraper::X::TweetDetail::CommunityNote::OrHash + ).void + end + attr_writer :community_note + # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) } @@ -80,6 +110,13 @@ module XTwitterScraper sig { params(display_text_range: T::Array[Integer]).void } attr_writer :display_text_range + # Edit history metadata returned by X. + sig { returns(T.nilable(XTwitterScraper::X::TweetDetail::Edit)) } + attr_reader :edit + + sig { params(edit: XTwitterScraper::X::TweetDetail::Edit::OrHash).void } + attr_writer :edit + # Parsed entities from the tweet text (URLs, mentions, hashtags, media) sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } attr_reader :entities @@ -136,6 +173,12 @@ module XTwitterScraper sig { params(is_reply: T::Boolean).void } attr_writer :is_reply + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_translatable + + sig { params(is_translatable: T::Boolean).void } + attr_writer :is_translatable + # Tweet language code sig { returns(T.nilable(String)) } attr_reader :lang @@ -152,6 +195,46 @@ module XTwitterScraper end attr_writer :media + # Complete Note Tweet content and rich-text metadata. + sig { returns(T.nilable(XTwitterScraper::X::TweetDetail::NoteTweet)) } + attr_reader :note_tweet + + sig do + params( + note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet::OrHash + ).void + end + attr_writer :note_tweet + + # Public place metadata attached to a tweet. + sig { returns(T.nilable(XTwitterScraper::X::TweetDetail::Place)) } + attr_reader :place + + sig do + params(place: XTwitterScraper::X::TweetDetail::Place::OrHash).void + end + attr_writer :place + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :possibly_sensitive + + sig { params(possibly_sensitive: T::Boolean).void } + attr_writer :possibly_sensitive + + # Engagement counts retained from a prior tweet edit. + sig do + returns(T.nilable(XTwitterScraper::X::TweetDetail::PreviousCounts)) + end + attr_reader :previous_counts + + sig do + params( + previous_counts: + XTwitterScraper::X::TweetDetail::PreviousCounts::OrHash + ).void + end + attr_writer :previous_counts + # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, # media, and conversation fields appear when available. @@ -195,6 +278,12 @@ module XTwitterScraper sig { params(url: String).void } attr_writer :url + sig { returns(T.nilable(String)) } + attr_reader :view_state + + sig { params(view_state: String).void } + attr_writer :view_state + # Full tweet with text, engagement metrics, media, and metadata. A zero metric can # mean X did not report the count. sig do @@ -207,11 +296,16 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::X::TweetDetail::Article::OrHash, author: XTwitterScraper::X::TweetAuthor::OrHash, + card: XTwitterScraper::X::TweetDetail::Card::OrHash, + community_note: + XTwitterScraper::X::TweetDetail::CommunityNote::OrHash, content_disclosure: XTwitterScraper::ContentDisclosure::OrHash, conversation_id: String, created_at: String, display_text_range: T::Array[Integer], + edit: XTwitterScraper::X::TweetDetail::Edit::OrHash, entities: T::Hash[Symbol, T.anything], in_reply_to_id: String, in_reply_to_user_id: String, @@ -220,13 +314,20 @@ module XTwitterScraper is_note_tweet: T::Boolean, is_quote_status: T::Boolean, is_reply: T::Boolean, + is_translatable: T::Boolean, lang: String, media: T::Array[XTwitterScraper::TweetMedia::OrHash], + note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet::OrHash, + place: XTwitterScraper::X::TweetDetail::Place::OrHash, + possibly_sensitive: T::Boolean, + previous_counts: + XTwitterScraper::X::TweetDetail::PreviousCounts::OrHash, quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash, source: String, type: String, - url: String + url: String, + view_state: String ).returns(T.attached_class) end def self.new( @@ -238,9 +339,15 @@ module XTwitterScraper retweet_count:, text:, view_count:, + # Article metadata attached to a tweet. + article: nil, # Tweet author profile. The lookup route always includes follower count and # verification state. Other profile fields appear when available. author: nil, + # Public card metadata attached to a tweet. + card: nil, + # Community Note presentation metadata returned by X. + community_note: nil, # Content disclosure metadata shown by X when a tweet is labeled as paid # partnership content or AI-generated media. content_disclosure: nil, @@ -249,6 +356,8 @@ module XTwitterScraper created_at: nil, # Start and end offsets for rendered tweet text display_text_range: nil, + # Edit history metadata returned by X. + edit: nil, # Parsed entities from the tweet text (URLs, mentions, hashtags, media) entities: nil, # Tweet ID being replied to @@ -265,10 +374,18 @@ module XTwitterScraper is_quote_status: nil, # Whether this tweet is a reply to another tweet is_reply: nil, + is_translatable: nil, # Tweet language code lang: nil, # Attached media items, omitted when the tweet has no media media: nil, + # Complete Note Tweet content and rich-text metadata. + note_tweet: nil, + # Public place metadata attached to a tweet. + place: nil, + possibly_sensitive: nil, + # Engagement counts retained from a prior tweet edit. + previous_counts: nil, # Quoted or retweeted tweet context. Every object includes id, text, and # engagement metrics. A zero metric can mean X did not report the count. Author, # media, and conversation fields appear when available. @@ -282,7 +399,8 @@ module XTwitterScraper # Tweet result type type: nil, # Tweet permalink URL - url: nil + url: nil, + view_state: nil ) end @@ -297,11 +415,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::X::TweetDetail::Article, author: XTwitterScraper::X::TweetAuthor, + card: XTwitterScraper::X::TweetDetail::Card, + community_note: XTwitterScraper::X::TweetDetail::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: T::Array[Integer], + edit: XTwitterScraper::X::TweetDetail::Edit, entities: T::Hash[Symbol, T.anything], in_reply_to_id: String, in_reply_to_user_id: String, @@ -310,18 +432,583 @@ module XTwitterScraper is_note_tweet: T::Boolean, is_quote_status: T::Boolean, is_reply: T::Boolean, + is_translatable: T::Boolean, lang: String, media: T::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, + place: XTwitterScraper::X::TweetDetail::Place, + possibly_sensitive: T::Boolean, + previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, quoted_tweet: XTwitterScraper::EmbeddedTweet, retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } ) end def to_hash end + + class Article < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::Article, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :cover_media_url + + sig { params(cover_media_url: String).void } + attr_writer :cover_media_url + + sig { returns(T.nilable(String)) } + attr_reader :preview_text + + sig { params(preview_text: String).void } + attr_writer :preview_text + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + # Article metadata attached to a tweet. + sig do + params( + id: String, + cover_media_url: String, + preview_text: String, + title: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + cover_media_url: nil, + preview_text: nil, + title: nil + ) + end + + sig do + override.returns( + { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + ) + end + def to_hash + end + end + + class Card < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::Card, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :binding_values + + sig { params(binding_values: T::Hash[Symbol, T.anything]).void } + attr_writer :binding_values + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Public card metadata attached to a tweet. + sig do + params( + id: String, + binding_values: T::Hash[Symbol, T.anything], + name: String, + url: String + ).returns(T.attached_class) + end + def self.new(id: nil, binding_values: nil, name: nil, url: nil) + end + + sig do + override.returns( + { + id: String, + binding_values: T::Hash[Symbol, T.anything], + name: String, + url: String + } + ) + end + def to_hash + end + end + + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::CommunityNote, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :destination_url + + sig { params(destination_url: String).void } + attr_writer :destination_url + + sig { returns(T.nilable(String)) } + attr_reader :footer + + sig { params(footer: String).void } + attr_writer :footer + + sig { returns(T.nilable(String)) } + attr_reader :short_title + + sig { params(short_title: String).void } + attr_writer :short_title + + sig { returns(T.nilable(String)) } + attr_reader :subtitle + + sig { params(subtitle: String).void } + attr_writer :subtitle + + sig { returns(T.nilable(String)) } + attr_reader :title + + sig { params(title: String).void } + attr_writer :title + + sig { returns(T.nilable(String)) } + attr_reader :visual_style + + sig { params(visual_style: String).void } + attr_writer :visual_style + + # Community Note presentation metadata returned by X. + sig do + params( + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + destination_url: nil, + footer: nil, + short_title: nil, + subtitle: nil, + title: nil, + visual_style: nil + ) + end + + sig do + override.returns( + { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + ) + end + def to_hash + end + end + + class Edit < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::Edit, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :editable_until_msecs + + sig { params(editable_until_msecs: String).void } + attr_writer :editable_until_msecs + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :edit_tweet_ids + + sig { params(edit_tweet_ids: T::Array[String]).void } + attr_writer :edit_tweet_ids + + # Edit history metadata returned by X. + sig do + params( + editable_until_msecs: String, + edit_tweet_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new(editable_until_msecs: nil, edit_tweet_ids: nil) + end + + sig do + override.returns( + { editable_until_msecs: String, edit_tweet_ids: T::Array[String] } + ) + end + def to_hash + end + end + + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::NoteTweet, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :text + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :entities + + sig { params(entities: T::Hash[Symbol, T.anything]).void } + attr_writer :entities + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_expandable + + sig { params(is_expandable: T::Boolean).void } + attr_writer :is_expandable + + sig do + returns( + T.nilable( + T::Array[ + XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag + ] + ) + ) + end + attr_reader :richtext_tags + + sig do + params( + richtext_tags: + T::Array[ + XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag::OrHash + ] + ).void + end + attr_writer :richtext_tags + + # Complete Note Tweet content and rich-text metadata. + sig do + params( + text: String, + id: String, + entities: T::Hash[Symbol, T.anything], + is_expandable: T::Boolean, + richtext_tags: + T::Array[ + XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + text:, + id: nil, + entities: nil, + is_expandable: nil, + richtext_tags: nil + ) + end + + sig do + override.returns( + { + text: String, + id: String, + entities: T::Hash[Symbol, T.anything], + is_expandable: T::Boolean, + richtext_tags: + T::Array[ + XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag + ] + } + ) + end + def to_hash + end + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :from_index + + sig { returns(Integer) } + attr_accessor :to_index + + sig { returns(T::Array[String]) } + attr_accessor :types + + sig do + params( + from_index: Integer, + to_index: Integer, + types: T::Array[String] + ).returns(T.attached_class) + end + def self.new(from_index:, to_index:, types:) + end + + sig do + override.returns( + { + from_index: Integer, + to_index: Integer, + types: T::Array[String] + } + ) + end + def to_hash + end + end + end + + class Place < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::Place, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :bounding_box + + sig { params(bounding_box: T::Hash[Symbol, T.anything]).void } + attr_writer :bounding_box + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :country_code + + sig { params(country_code: String).void } + attr_writer :country_code + + sig { returns(T.nilable(String)) } + attr_reader :full_name + + sig { params(full_name: String).void } + attr_writer :full_name + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :place_type + + sig { params(place_type: String).void } + attr_writer :place_type + + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + # Public place metadata attached to a tweet. + sig do + params( + id: String, + bounding_box: T::Hash[Symbol, T.anything], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + ).returns(T.attached_class) + end + def self.new( + id: nil, + bounding_box: nil, + country: nil, + country_code: nil, + full_name: nil, + name: nil, + place_type: nil, + url: nil + ) + end + + sig do + override.returns( + { + id: String, + bounding_box: T::Hash[Symbol, T.anything], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + ) + end + def to_hash + end + end + + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::X::TweetDetail::PreviousCounts, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_reader :bookmark_count + + sig { params(bookmark_count: Integer).void } + attr_writer :bookmark_count + + sig { returns(T.nilable(Integer)) } + attr_reader :like_count + + sig { params(like_count: Integer).void } + attr_writer :like_count + + sig { returns(T.nilable(Integer)) } + attr_reader :quote_count + + sig { params(quote_count: Integer).void } + attr_writer :quote_count + + sig { returns(T.nilable(Integer)) } + attr_reader :reply_count + + sig { params(reply_count: Integer).void } + attr_writer :reply_count + + sig { returns(T.nilable(Integer)) } + attr_reader :retweet_count + + sig { params(retweet_count: Integer).void } + attr_writer :retweet_count + + # Engagement counts retained from a prior tweet edit. + sig do + params( + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + ).returns(T.attached_class) + end + def self.new( + bookmark_count: nil, + like_count: nil, + quote_count: nil, + reply_count: nil, + retweet_count: nil + ) + end + + sig do + override.returns( + { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + ) + end + def to_hash + end + end end end end 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 dc34f84..b02f3c4 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 @@ -153,10 +153,8 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -355,10 +353,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. 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 8aadec5..52f835f 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 @@ -93,6 +93,15 @@ module XTwitterScraper sig { params(language: String).void } attr_writer :language + # With mode=complete, maximum combined direct and nested reply rows (1-25000). + # Without complete mode, this is the deprecated pageSize alias and uses the normal + # 1-100 page range. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + # Filter by media type. sig do returns( @@ -146,10 +155,24 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # Set complete for maximum-coverage collection. Complete mode accepts only limit. + # Remove cursor, pageSize, count, time ranges, and tweet filters. + sig do + returns( + T.nilable(XTwitterScraper::X::TweetGetRepliesParams::Mode::OrSymbol) + ) + end + attr_reader :mode + + sig do + params( + mode: XTwitterScraper::X::TweetGetRepliesParams::Mode::OrSymbol + ).void + end + attr_writer :mode + + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -286,6 +309,7 @@ module XTwitterScraper hashtags: String, in_reply_to_tweet_id: String, language: String, + limit: Integer, media_type: XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol, mentioning: String, @@ -293,6 +317,7 @@ module XTwitterScraper min_quotes: Integer, min_replies: Integer, min_retweets: Integer, + mode: XTwitterScraper::X::TweetGetRepliesParams::Mode::OrSymbol, page_size: Integer, quotes: XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol, quotes_of_tweet_id: String, @@ -334,6 +359,10 @@ module XTwitterScraper in_reply_to_tweet_id: nil, # Language code filter, e.g. en or tr. language: nil, + # With mode=complete, maximum combined direct and nested reply rows (1-25000). + # Without complete mode, this is the deprecated pageSize alias and uses the normal + # 1-100 page range. + limit: nil, # Filter by media type. media_type: nil, # Filter tweets mentioning a username. @@ -346,10 +375,11 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # Set complete for maximum-coverage collection. Complete mode accepts only limit. + # Remove cursor, pageSize, count, time ranges, and tweet filters. + mode: 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. @@ -394,6 +424,7 @@ module XTwitterScraper hashtags: String, in_reply_to_tweet_id: String, language: String, + limit: Integer, media_type: XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol, mentioning: String, @@ -401,6 +432,7 @@ module XTwitterScraper min_quotes: Integer, min_replies: Integer, min_retweets: Integer, + mode: XTwitterScraper::X::TweetGetRepliesParams::Mode::OrSymbol, page_size: Integer, quotes: XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol, @@ -479,6 +511,34 @@ module XTwitterScraper end end + # Set complete for maximum-coverage collection. Complete mode accepts only limit. + # Remove cursor, pageSize, count, time ranges, and tweet filters. + module Mode + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, XTwitterScraper::X::TweetGetRepliesParams::Mode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETE = + T.let( + :complete, + XTwitterScraper::X::TweetGetRepliesParams::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::X::TweetGetRepliesParams::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + # Quote mode. module Quotes extend XTwitterScraper::Internal::Type::Enum diff --git a/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi b/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi new file mode 100644 index 0000000..5f7a267 --- /dev/null +++ b/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi @@ -0,0 +1,527 @@ +# typed: strong + +module XTwitterScraper + module Models + module X + class TweetGetRepliesResponse < XTwitterScraper::Models::PaginatedTweets + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetGetRepliesResponse, + XTwitterScraper::Internal::AnyHash + ) + end + + # Evidence for direct-reply coverage and collector behavior. + sig do + returns( + T.nilable( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic + ) + ) + end + attr_reader :diagnostic + + sig do + params( + diagnostic: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::OrHash + ).void + end + attr_writer :diagnostic + + # Nested replies. Excluded from direct coverage. + sig { returns(T.nilable(T::Array[XTwitterScraper::SearchTweet])) } + attr_reader :nested_replies + + sig do + params( + nested_replies: T::Array[XTwitterScraper::SearchTweet::OrHash] + ).void + end + attr_writer :nested_replies + + # Reply rows. Complete mode also returns nested replies and coverage diagnostics. + # Keep nested replies separate from direct coverage. + sig do + params( + diagnostic: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::OrHash, + nested_replies: T::Array[XTwitterScraper::SearchTweet::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Evidence for direct-reply coverage and collector behavior. + diagnostic: nil, + # Nested replies. Excluded from direct coverage. + nested_replies: nil + ) + end + + sig do + override.returns( + { + diagnostic: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic, + nested_replies: T::Array[XTwitterScraper::SearchTweet] + } + ) + end + def to_hash + end + + class Diagnostic < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic, + XTwitterScraper::Internal::AnyHash + ) + end + + # Whether coverage met the target without truncation. + sig { returns(T::Boolean) } + attr_accessor :complete + + # Unique direct replies as a percentage of the reported count. + sig { returns(Float) } + attr_accessor :coverage_percentage + + # Cursor requests that failed. + sig { returns(Integer) } + attr_accessor :cursor_failures + + # Duplicate tweet IDs removed across pages and strategies. + sig { returns(Integer) } + attr_accessor :duplicate_count + + # Empty pages rejected because they did not make progress. + sig { returns(Integer) } + attr_accessor :empty_false_progress_pages + + # Malformed response items rejected. + sig { returns(Integer) } + attr_accessor :malformed_count + + # Expected response modules or fields missing from X. + sig { returns(T::Array[String]) } + attr_accessor :missing_response_modules_or_fields + + # Unique nested replies kept outside direct coverage. + sig { returns(Integer) } + attr_accessor :nested_reply_count + + # Total pages attempted across all strategies. + sig { returns(Integer) } + attr_accessor :pages_attempted + + # Recommended next action when coverage is incomplete. + sig { returns(String) } + attr_accessor :recommended_fallback + + # Repeated cursors rejected to prevent loops. + sig { returns(Integer) } + attr_accessor :repeated_cursor_count + + # Reply count reported on the source post. + sig { returns(Integer) } + attr_accessor :reported_reply_count + + # Whether the requested row limit truncated safe results. + sig { returns(T::Boolean) } + attr_accessor :response_truncated + + # Field-presence counts across the collected direct replies. + sig do + returns( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness + ) + end + attr_reader :richness + + sig do + params( + richness: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness::OrHash + ).void + end + attr_writer :richness + + # Per-strategy pagination and contribution evidence. + sig do + returns( + T::Array[ + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted + ] + ) + end + attr_accessor :strategies_attempted + + # Minimum direct replies required for the coverage target. + sig { returns(Integer) } + attr_accessor :target_direct_replies + + # Unique replies whose parent ID equals the source post ID. + sig { returns(Integer) } + attr_accessor :unique_direct_replies + + # Tweets rejected because they belonged elsewhere. + sig { returns(Integer) } + attr_accessor :unrelated_count + + # Evidence for direct-reply coverage and collector behavior. + sig do + params( + complete: T::Boolean, + coverage_percentage: Float, + cursor_failures: Integer, + duplicate_count: Integer, + empty_false_progress_pages: Integer, + malformed_count: Integer, + missing_response_modules_or_fields: T::Array[String], + nested_reply_count: Integer, + pages_attempted: Integer, + recommended_fallback: String, + repeated_cursor_count: Integer, + reported_reply_count: Integer, + response_truncated: T::Boolean, + richness: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness::OrHash, + strategies_attempted: + T::Array[ + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::OrHash + ], + target_direct_replies: Integer, + unique_direct_replies: Integer, + unrelated_count: Integer + ).returns(T.attached_class) + end + def self.new( + # Whether coverage met the target without truncation. + complete:, + # Unique direct replies as a percentage of the reported count. + coverage_percentage:, + # Cursor requests that failed. + cursor_failures:, + # Duplicate tweet IDs removed across pages and strategies. + duplicate_count:, + # Empty pages rejected because they did not make progress. + empty_false_progress_pages:, + # Malformed response items rejected. + malformed_count:, + # Expected response modules or fields missing from X. + missing_response_modules_or_fields:, + # Unique nested replies kept outside direct coverage. + nested_reply_count:, + # Total pages attempted across all strategies. + pages_attempted:, + # Recommended next action when coverage is incomplete. + recommended_fallback:, + # Repeated cursors rejected to prevent loops. + repeated_cursor_count:, + # Reply count reported on the source post. + reported_reply_count:, + # Whether the requested row limit truncated safe results. + response_truncated:, + # Field-presence counts across the collected direct replies. + richness:, + # Per-strategy pagination and contribution evidence. + strategies_attempted:, + # Minimum direct replies required for the coverage target. + target_direct_replies:, + # Unique replies whose parent ID equals the source post ID. + unique_direct_replies:, + # Tweets rejected because they belonged elsewhere. + unrelated_count: + ) + end + + sig do + override.returns( + { + complete: T::Boolean, + coverage_percentage: Float, + cursor_failures: Integer, + duplicate_count: Integer, + empty_false_progress_pages: Integer, + malformed_count: Integer, + missing_response_modules_or_fields: T::Array[String], + nested_reply_count: Integer, + pages_attempted: Integer, + recommended_fallback: String, + repeated_cursor_count: Integer, + reported_reply_count: Integer, + response_truncated: T::Boolean, + richness: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness, + strategies_attempted: + T::Array[ + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted + ], + target_direct_replies: Integer, + unique_direct_replies: Integer, + unrelated_count: Integer + } + ) + end + def to_hash + end + + class Richness < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness, + XTwitterScraper::Internal::AnyHash + ) + end + + # Replies with article content. + sig { returns(Integer) } + attr_accessor :article + + # Replies with author details. + sig { returns(Integer) } + attr_accessor :author + + # Replies with card metadata. + sig { returns(Integer) } + attr_accessor :card + + # Replies with community-note data. + sig { returns(Integer) } + attr_accessor :community_note + + # Replies with a creation timestamp. + sig { returns(Integer) } + attr_accessor :created_at + + # Replies with engagement counts. + sig { returns(Integer) } + attr_accessor :engagement_counts + + # Replies with entity metadata. + sig { returns(Integer) } + attr_accessor :entities + + # Replies with a language value. + sig { returns(Integer) } + attr_accessor :language + + # Replies with media metadata. + sig { returns(Integer) } + attr_accessor :media + + # Replies with quoted or reposted tweet data. + sig { returns(Integer) } + attr_accessor :quoted_or_reposted_tweet + + # Replies with text. + sig { returns(Integer) } + attr_accessor :text + + # Total unique direct replies evaluated for richness. + sig { returns(Integer) } + attr_accessor :total_replies + + # Replies with a canonical URL. + sig { returns(Integer) } + attr_accessor :url + + # Field-presence counts across the collected direct replies. + sig do + params( + article: Integer, + author: Integer, + card: Integer, + community_note: Integer, + created_at: Integer, + engagement_counts: Integer, + entities: Integer, + language: Integer, + media: Integer, + quoted_or_reposted_tweet: Integer, + text: Integer, + total_replies: Integer, + url: Integer + ).returns(T.attached_class) + end + def self.new( + # Replies with article content. + article:, + # Replies with author details. + author:, + # Replies with card metadata. + card:, + # Replies with community-note data. + community_note:, + # Replies with a creation timestamp. + created_at:, + # Replies with engagement counts. + engagement_counts:, + # Replies with entity metadata. + entities:, + # Replies with a language value. + language:, + # Replies with media metadata. + media:, + # Replies with quoted or reposted tweet data. + quoted_or_reposted_tweet:, + # Replies with text. + text:, + # Total unique direct replies evaluated for richness. + total_replies:, + # Replies with a canonical URL. + url: + ) + end + + sig do + override.returns( + { + article: Integer, + author: Integer, + card: Integer, + community_note: Integer, + created_at: Integer, + engagement_counts: Integer, + entities: Integer, + language: Integer, + media: Integer, + quoted_or_reposted_tweet: Integer, + text: Integer, + total_replies: Integer, + url: Integer + } + ) + end + def to_hash + end + end + + class StrategiesAttempted < XTwitterScraper::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted, + XTwitterScraper::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(Integer) } + attr_accessor :new_direct_replies + + sig { returns(Integer) } + attr_accessor :new_nested_replies + + sig { returns(Integer) } + attr_accessor :pages_attempted + + sig do + returns( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + end + attr_accessor :stop_reason + + sig do + params( + name: String, + new_direct_replies: Integer, + new_nested_replies: Integer, + pages_attempted: Integer, + stop_reason: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + name:, + new_direct_replies:, + new_nested_replies:, + pages_attempted:, + stop_reason: + ) + end + + sig do + override.returns( + { + name: String, + new_direct_replies: Integer, + new_nested_replies: Integer, + pages_attempted: Integer, + stop_reason: + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + } + ) + end + def to_hash + end + + module StopReason + extend XTwitterScraper::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEADLINE = + T.let( + :deadline, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + EMPTY_PAGES = + T.let( + :empty_pages, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + ERROR = + T.let( + :error, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + MISSING_CURSOR = + T.let( + :missing_cursor, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + NO_NEXT_PAGE = + T.let( + :no_next_page, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + PAGE_CAP = + T.let( + :page_cap, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + REPEATED_CURSOR = + T.let( + :repeated_cursor, + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::StopReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end 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 5cdfe03..b999a7b 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 @@ -29,10 +29,8 @@ module XTwitterScraper sig { params(cursor: String).void } attr_writer :cursor - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -52,10 +50,8 @@ module XTwitterScraper id:, # Pagination cursor for thread tweets cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, request_options: {} 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 74bab89..9c34401 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 @@ -146,10 +146,8 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -332,10 +330,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. 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 413995b..70753b6 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 @@ -146,10 +146,8 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -332,10 +330,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. 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 0a1a7e5..af559bf 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 @@ -146,10 +146,8 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -348,10 +346,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. 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 9948363..b51be4b 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 @@ -153,10 +153,8 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -342,10 +340,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. 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 8c6fc54..16db237 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 @@ -160,10 +160,8 @@ module XTwitterScraper sig { params(min_retweets: Integer).void } attr_writer :min_retweets - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. sig { returns(T.nilable(Integer)) } attr_reader :page_size @@ -352,10 +350,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. diff --git a/rbi/x_twitter_scraper/models/x_get_article_response.rbi b/rbi/x_twitter_scraper/models/x_get_article_response.rbi index bf9bbbd..3585376 100644 --- a/rbi/x_twitter_scraper/models/x_get_article_response.rbi +++ b/rbi/x_twitter_scraper/models/x_get_article_response.rbi @@ -388,12 +388,6 @@ module XTwitterScraper sig { returns(String) } attr_accessor :username - sig { returns(T.nilable(T::Boolean)) } - attr_reader :can_dm - - sig { params(can_dm: T::Boolean).void } - attr_writer :can_dm - sig { returns(T.nilable(String)) } attr_reader :created_at @@ -490,7 +484,6 @@ module XTwitterScraper id: String, name: String, username: String, - can_dm: T::Boolean, created_at: String, description: String, favourites_count: Integer, @@ -512,7 +505,6 @@ module XTwitterScraper id:, name:, username:, - can_dm: nil, created_at: nil, description: nil, favourites_count: nil, @@ -537,7 +529,6 @@ module XTwitterScraper id: String, name: String, username: String, - can_dm: T::Boolean, created_at: String, description: String, favourites_count: Integer, diff --git a/rbi/x_twitter_scraper/models/x_get_trends_response.rbi b/rbi/x_twitter_scraper/models/x_get_trends_response.rbi index e84aa8a..e9f3b01 100644 --- a/rbi/x_twitter_scraper/models/x_get_trends_response.rbi +++ b/rbi/x_twitter_scraper/models/x_get_trends_response.rbi @@ -70,6 +70,10 @@ module XTwitterScraper sig { params(description: String).void } attr_writer :description + # Promotion identifier from X. Null for organic trends. + sig { returns(T.nilable(String)) } + attr_accessor :promoted_content + sig { returns(T.nilable(String)) } attr_reader :query @@ -82,20 +86,53 @@ module XTwitterScraper sig { params(rank: Integer).void } attr_writer :rank + # Approximate public post volume when X supplies it. + sig { returns(T.nilable(Integer)) } + attr_accessor :tweet_volume + + # X search URL for the trend. + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + sig do params( name: String, description: String, + promoted_content: T.nilable(String), query: String, - rank: Integer + rank: Integer, + tweet_volume: T.nilable(Integer), + url: String ).returns(T.attached_class) end - def self.new(name:, description: nil, query: nil, rank: nil) + def self.new( + name:, + description: nil, + # Promotion identifier from X. Null for organic trends. + promoted_content: nil, + query: nil, + rank: nil, + # Approximate public post volume when X supplies it. + tweet_volume: nil, + # X search URL for the trend. + url: nil + ) end sig do override.returns( - { name: String, description: String, query: String, rank: Integer } + { + name: String, + description: String, + promoted_content: T.nilable(String), + query: String, + rank: Integer, + tweet_volume: T.nilable(Integer), + url: String + } ) end def to_hash diff --git a/rbi/x_twitter_scraper/resources/x/accounts.rbi b/rbi/x_twitter_scraper/resources/x/accounts.rbi index 41742a8..e0bcb8f 100644 --- a/rbi/x_twitter_scraper/resources/x/accounts.rbi +++ b/rbi/x_twitter_scraper/resources/x/accounts.rbi @@ -17,7 +17,7 @@ module XTwitterScraper totp_secret: String, username: String, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(T.anything) + ).returns(XTwitterScraper::Models::X::AccountCreateResponse::Variants) end def create( # Account email diff --git a/rbi/x_twitter_scraper/resources/x/communities.rbi b/rbi/x_twitter_scraper/resources/x/communities.rbi index 2e27391..29a9459 100644 --- a/rbi/x_twitter_scraper/resources/x/communities.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities.rbi @@ -140,10 +140,8 @@ module XTwitterScraper q:, # Pagination cursor for community search cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, # Sort order (Latest or Top) diff --git a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi index b695769..02a1a2f 100644 --- a/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi @@ -29,10 +29,8 @@ module XTwitterScraper q:, # Pagination cursor for community results cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, # Sort order for community results (Latest or Top) @@ -55,10 +53,8 @@ module XTwitterScraper id, # Pagination cursor for community tweets cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, request_options: {} diff --git a/rbi/x_twitter_scraper/resources/x/lists.rbi b/rbi/x_twitter_scraper/resources/x/lists.rbi index a2e9f3f..f8c9a87 100644 --- a/rbi/x_twitter_scraper/resources/x/lists.rbi +++ b/rbi/x_twitter_scraper/resources/x/lists.rbi @@ -71,10 +71,8 @@ module XTwitterScraper cursor: nil, # Include replies (default false) include_replies: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, # Unix timestamp - filter after diff --git a/rbi/x_twitter_scraper/resources/x/tweets.rbi b/rbi/x_twitter_scraper/resources/x/tweets.rbi index c033d29..79708bb 100644 --- a/rbi/x_twitter_scraper/resources/x/tweets.rbi +++ b/rbi/x_twitter_scraper/resources/x/tweets.rbi @@ -207,10 +207,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. @@ -241,11 +239,10 @@ module XTwitterScraper ) end - # Returns visible replies. For an unfiltered first page, Xquik compares a terminal - # page with the post's reported reply count. If the page is visibly incomplete, - # the endpoint returns 424 `replies_incomplete` instead of presenting partial - # coverage as complete. Use tweet search with a `conversation_id:{id}` query as - # the broader fallback. + # Returns direct replies. Complete mode merges available timeline views, supported + # rankings, every forward cursor module, labeled hidden-content branches, + # exact-parent time partitions scaled to the reported reply count, and search. It + # separates nested replies and returns 424 below 80% coverage. sig do params( id: String, @@ -259,6 +256,7 @@ module XTwitterScraper hashtags: String, in_reply_to_tweet_id: String, language: String, + limit: Integer, media_type: XTwitterScraper::X::TweetGetRepliesParams::MediaType::OrSymbol, mentioning: String, @@ -266,6 +264,7 @@ module XTwitterScraper min_quotes: Integer, min_replies: Integer, min_retweets: Integer, + mode: XTwitterScraper::X::TweetGetRepliesParams::Mode::OrSymbol, page_size: Integer, quotes: XTwitterScraper::X::TweetGetRepliesParams::Quotes::OrSymbol, quotes_of_tweet_id: String, @@ -282,7 +281,7 @@ module XTwitterScraper url: String, verified_only: T::Boolean, request_options: XTwitterScraper::RequestOptions::OrHash - ).returns(XTwitterScraper::PaginatedTweets) + ).returns(XTwitterScraper::Models::X::TweetGetRepliesResponse) end def get_replies( # Tweet ID to get replies @@ -308,6 +307,10 @@ module XTwitterScraper in_reply_to_tweet_id: nil, # Language code filter, e.g. en or tr. language: nil, + # With mode=complete, maximum combined direct and nested reply rows (1-25000). + # Without complete mode, this is the deprecated pageSize alias and uses the normal + # 1-100 page range. + limit: nil, # Filter by media type. media_type: nil, # Filter tweets mentioning a username. @@ -320,10 +323,11 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # Set complete for maximum-coverage collection. Complete mode accepts only limit. + # Remove cursor, pageSize, count, time ranges, and tweet filters. + mode: 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. @@ -391,10 +395,8 @@ module XTwitterScraper id, # Pagination cursor for thread tweets cursor: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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, request_options: {} diff --git a/rbi/x_twitter_scraper/resources/x/users.rbi b/rbi/x_twitter_scraper/resources/x/users.rbi index 83fd980..474a683 100644 --- a/rbi/x_twitter_scraper/resources/x/users.rbi +++ b/rbi/x_twitter_scraper/resources/x/users.rbi @@ -219,10 +219,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. @@ -323,10 +321,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. @@ -429,10 +425,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. @@ -540,10 +534,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. @@ -667,10 +659,8 @@ module XTwitterScraper min_replies: nil, # Minimum retweets threshold. min_retweets: nil, - # Maximum items requested from this page (1-100, default 20). The response can - # contain fewer items because the source returned fewer, filters removed items, or - # remaining credits cover fewer results. Keep requesting next_cursor while - # has_next_page is true, even when a page is empty. The deprecated limit and count + # 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. diff --git a/sig/x_twitter_scraper/models/content_disclosure.rbs b/sig/x_twitter_scraper/models/content_disclosure.rbs index 9c85f7d..d78a6f1 100644 --- a/sig/x_twitter_scraper/models/content_disclosure.rbs +++ b/sig/x_twitter_scraper/models/content_disclosure.rbs @@ -46,17 +46,9 @@ module XTwitterScraper end type ai_generated = - { - can_edit: bool, - detection_source: String, - has_ai_generated_media: bool - } + { detection_source: String, has_ai_generated_media: bool } class AIGenerated < XTwitterScraper::Internal::Type::BaseModel - attr_reader can_edit: bool? - - def can_edit=: (bool) -> bool - attr_reader detection_source: String? def detection_source=: (String) -> String @@ -66,13 +58,11 @@ module XTwitterScraper def has_ai_generated_media=: (bool) -> bool def initialize: ( - ?can_edit: bool, ?detection_source: String, ?has_ai_generated_media: bool ) -> void def to_hash: -> { - can_edit: bool, detection_source: String, has_ai_generated_media: bool } diff --git a/sig/x_twitter_scraper/models/embedded_tweet.rbs b/sig/x_twitter_scraper/models/embedded_tweet.rbs index f301ede..d9ad9f0 100644 --- a/sig/x_twitter_scraper/models/embedded_tweet.rbs +++ b/sig/x_twitter_scraper/models/embedded_tweet.rbs @@ -14,11 +14,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::EmbeddedTweet::Article, author: XTwitterScraper::UserProfile, + card: XTwitterScraper::EmbeddedTweet::Card, + community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: ::Array[Integer], + edit: XTwitterScraper::EmbeddedTweet::Edit, entities: ::Hash[Symbol, top], in_reply_to_id: String, in_reply_to_user_id: String, @@ -27,11 +31,19 @@ module XTwitterScraper is_note_tweet: bool, is_quote_status: bool, is_reply: bool, + is_translatable: bool, lang: String, media: ::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, + place: XTwitterScraper::EmbeddedTweet::Place, + possibly_sensitive: bool, + previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel @@ -51,12 +63,30 @@ module XTwitterScraper attr_accessor view_count: Integer + attr_reader article: XTwitterScraper::EmbeddedTweet::Article? + + def article=: ( + XTwitterScraper::EmbeddedTweet::Article + ) -> XTwitterScraper::EmbeddedTweet::Article + attr_reader author: XTwitterScraper::UserProfile? def author=: ( XTwitterScraper::UserProfile ) -> XTwitterScraper::UserProfile + attr_reader card: XTwitterScraper::EmbeddedTweet::Card? + + def card=: ( + XTwitterScraper::EmbeddedTweet::Card + ) -> XTwitterScraper::EmbeddedTweet::Card + + attr_reader community_note: XTwitterScraper::EmbeddedTweet::CommunityNote? + + def community_note=: ( + XTwitterScraper::EmbeddedTweet::CommunityNote + ) -> XTwitterScraper::EmbeddedTweet::CommunityNote + attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? def content_disclosure=: ( @@ -75,6 +105,12 @@ module XTwitterScraper def display_text_range=: (::Array[Integer]) -> ::Array[Integer] + attr_reader edit: XTwitterScraper::EmbeddedTweet::Edit? + + def edit=: ( + XTwitterScraper::EmbeddedTweet::Edit + ) -> XTwitterScraper::EmbeddedTweet::Edit + attr_reader entities: ::Hash[Symbol, top]? def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -107,6 +143,10 @@ module XTwitterScraper def is_reply=: (bool) -> bool + attr_reader is_translatable: bool? + + def is_translatable=: (bool) -> bool + attr_reader lang: String? def lang=: (String) -> String @@ -117,6 +157,40 @@ module XTwitterScraper ::Array[XTwitterScraper::TweetMedia] ) -> ::Array[XTwitterScraper::TweetMedia] + attr_reader note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet? + + def note_tweet=: ( + XTwitterScraper::EmbeddedTweet::NoteTweet + ) -> XTwitterScraper::EmbeddedTweet::NoteTweet + + attr_reader place: XTwitterScraper::EmbeddedTweet::Place? + + def place=: ( + XTwitterScraper::EmbeddedTweet::Place + ) -> XTwitterScraper::EmbeddedTweet::Place + + attr_reader possibly_sensitive: bool? + + def possibly_sensitive=: (bool) -> bool + + attr_reader previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts? + + def previous_counts=: ( + XTwitterScraper::EmbeddedTweet::PreviousCounts + ) -> XTwitterScraper::EmbeddedTweet::PreviousCounts + + attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? + + def quoted_tweet=: ( + XTwitterScraper::EmbeddedTweet + ) -> XTwitterScraper::EmbeddedTweet + + attr_reader retweeted_tweet: XTwitterScraper::EmbeddedTweet? + + def retweeted_tweet=: ( + XTwitterScraper::EmbeddedTweet + ) -> XTwitterScraper::EmbeddedTweet + attr_reader source: String? def source=: (String) -> String @@ -129,6 +203,10 @@ module XTwitterScraper def url=: (String) -> String + attr_reader view_state: String? + + def view_state=: (String) -> String + def initialize: ( id: String, bookmark_count: Integer, @@ -138,11 +216,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + ?article: XTwitterScraper::EmbeddedTweet::Article, ?author: XTwitterScraper::UserProfile, + ?card: XTwitterScraper::EmbeddedTweet::Card, + ?community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, ?content_disclosure: XTwitterScraper::ContentDisclosure, ?conversation_id: String, ?created_at: String, ?display_text_range: ::Array[Integer], + ?edit: XTwitterScraper::EmbeddedTweet::Edit, ?entities: ::Hash[Symbol, top], ?in_reply_to_id: String, ?in_reply_to_user_id: String, @@ -151,11 +233,19 @@ module XTwitterScraper ?is_note_tweet: bool, ?is_quote_status: bool, ?is_reply: bool, + ?is_translatable: bool, ?lang: String, ?media: ::Array[XTwitterScraper::TweetMedia], + ?note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, + ?place: XTwitterScraper::EmbeddedTweet::Place, + ?possibly_sensitive: bool, + ?previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, + ?quoted_tweet: XTwitterScraper::EmbeddedTweet, + ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, ?source: String, ?type: String, - ?url: String + ?url: String, + ?view_state: String ) -> void def to_hash: -> { @@ -167,11 +257,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::EmbeddedTweet::Article, author: XTwitterScraper::UserProfile, + card: XTwitterScraper::EmbeddedTweet::Card, + community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: ::Array[Integer], + edit: XTwitterScraper::EmbeddedTweet::Edit, entities: ::Hash[Symbol, top], in_reply_to_id: String, in_reply_to_user_id: String, @@ -180,12 +274,369 @@ module XTwitterScraper is_note_tweet: bool, is_quote_status: bool, is_reply: bool, + is_translatable: bool, lang: String, media: ::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, + place: XTwitterScraper::EmbeddedTweet::Place, + possibly_sensitive: bool, + previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, + quoted_tweet: XTwitterScraper::EmbeddedTweet, + retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } + + type article = + { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + + class Article < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader cover_media_url: String? + + def cover_media_url=: (String) -> String + + attr_reader preview_text: String? + + def preview_text=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + ?id: String, + ?cover_media_url: String, + ?preview_text: String, + ?title: String + ) -> void + + def to_hash: -> { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + end + + type card = + { + id: String, + binding_values: ::Hash[Symbol, top], + name: String, + url: String + } + + class Card < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader binding_values: ::Hash[Symbol, top]? + + def binding_values=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?id: String, + ?binding_values: ::Hash[Symbol, top], + ?name: String, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + binding_values: ::Hash[Symbol, top], + name: String, + url: String + } + end + + type community_note = + { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader destination_url: String? + + def destination_url=: (String) -> String + + attr_reader footer: String? + + def footer=: (String) -> String + + attr_reader short_title: String? + + def short_title=: (String) -> String + + attr_reader subtitle: String? + + def subtitle=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + attr_reader visual_style: String? + + def visual_style=: (String) -> String + + def initialize: ( + ?id: String, + ?destination_url: String, + ?footer: String, + ?short_title: String, + ?subtitle: String, + ?title: String, + ?visual_style: String + ) -> void + + def to_hash: -> { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + end + + type edit = + { editable_until_msecs: String, edit_tweet_ids: ::Array[String] } + + class Edit < XTwitterScraper::Internal::Type::BaseModel + attr_reader editable_until_msecs: String? + + def editable_until_msecs=: (String) -> String + + attr_reader edit_tweet_ids: ::Array[String]? + + def edit_tweet_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?editable_until_msecs: String, + ?edit_tweet_ids: ::Array[String] + ) -> void + + def to_hash: -> { + editable_until_msecs: String, + edit_tweet_ids: ::Array[String] + } + end + + type note_tweet = + { + text: String, + id: String, + entities: ::Hash[Symbol, top], + is_expandable: bool, + richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + } + + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + attr_accessor text: String + + attr_reader id: String? + + def id=: (String) -> String + + attr_reader entities: ::Hash[Symbol, top]? + + def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader is_expandable: bool? + + def is_expandable=: (bool) -> bool + + attr_reader richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag]? + + def richtext_tags=: ( + ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + ) -> ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + + def initialize: ( + text: String, + ?id: String, + ?entities: ::Hash[Symbol, top], + ?is_expandable: bool, + ?richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + ) -> void + + def to_hash: -> { + text: String, + id: String, + entities: ::Hash[Symbol, top], + is_expandable: bool, + richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] + } + + type richtext_tag = + { from_index: Integer, to_index: Integer, types: ::Array[String] } + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + attr_accessor from_index: Integer + + attr_accessor to_index: Integer + + attr_accessor types: ::Array[String] + + def initialize: ( + from_index: Integer, + to_index: Integer, + types: ::Array[String] + ) -> void + + def to_hash: -> { + from_index: Integer, + to_index: Integer, + types: ::Array[String] + } + end + end + + type place = + { + id: String, + bounding_box: ::Hash[Symbol, top], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + + class Place < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader bounding_box: ::Hash[Symbol, top]? + + def bounding_box=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader country_code: String? + + def country_code=: (String) -> String + + attr_reader full_name: String? + + def full_name=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader place_type: String? + + def place_type=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?id: String, + ?bounding_box: ::Hash[Symbol, top], + ?country: String, + ?country_code: String, + ?full_name: String, + ?name: String, + ?place_type: String, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + bounding_box: ::Hash[Symbol, top], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + end + + type previous_counts = + { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + attr_reader bookmark_count: Integer? + + def bookmark_count=: (Integer) -> Integer + + attr_reader like_count: Integer? + + def like_count=: (Integer) -> Integer + + attr_reader quote_count: Integer? + + def quote_count=: (Integer) -> Integer + + attr_reader reply_count: Integer? + + def reply_count=: (Integer) -> Integer + + attr_reader retweet_count: Integer? + + def retweet_count=: (Integer) -> Integer + + def initialize: ( + ?bookmark_count: Integer, + ?like_count: Integer, + ?quote_count: Integer, + ?reply_count: Integer, + ?retweet_count: Integer + ) -> void + + def to_hash: -> { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + end end end end diff --git a/sig/x_twitter_scraper/models/search_tweet.rbs b/sig/x_twitter_scraper/models/search_tweet.rbs index 402fc42..0e65f13 100644 --- a/sig/x_twitter_scraper/models/search_tweet.rbs +++ b/sig/x_twitter_scraper/models/search_tweet.rbs @@ -14,11 +14,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::SearchTweet::Article, author: XTwitterScraper::UserProfile, + card: XTwitterScraper::SearchTweet::Card, + community_note: XTwitterScraper::SearchTweet::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: ::Array[Integer], + edit: XTwitterScraper::SearchTweet::Edit, entities: ::Hash[Symbol, top], in_reply_to_id: String, in_reply_to_user_id: String, @@ -27,13 +31,19 @@ module XTwitterScraper is_note_tweet: bool, is_quote_status: bool, is_reply: bool, + is_translatable: bool, lang: String, media: ::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::SearchTweet::NoteTweet, + place: XTwitterScraper::SearchTweet::Place, + possibly_sensitive: bool, + previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, quoted_tweet: XTwitterScraper::EmbeddedTweet, retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } class SearchTweet < XTwitterScraper::Internal::Type::BaseModel @@ -53,12 +63,30 @@ module XTwitterScraper attr_accessor view_count: Integer + attr_reader article: XTwitterScraper::SearchTweet::Article? + + def article=: ( + XTwitterScraper::SearchTweet::Article + ) -> XTwitterScraper::SearchTweet::Article + attr_reader author: XTwitterScraper::UserProfile? def author=: ( XTwitterScraper::UserProfile ) -> XTwitterScraper::UserProfile + attr_reader card: XTwitterScraper::SearchTweet::Card? + + def card=: ( + XTwitterScraper::SearchTweet::Card + ) -> XTwitterScraper::SearchTweet::Card + + attr_reader community_note: XTwitterScraper::SearchTweet::CommunityNote? + + def community_note=: ( + XTwitterScraper::SearchTweet::CommunityNote + ) -> XTwitterScraper::SearchTweet::CommunityNote + attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? def content_disclosure=: ( @@ -77,6 +105,12 @@ module XTwitterScraper def display_text_range=: (::Array[Integer]) -> ::Array[Integer] + attr_reader edit: XTwitterScraper::SearchTweet::Edit? + + def edit=: ( + XTwitterScraper::SearchTweet::Edit + ) -> XTwitterScraper::SearchTweet::Edit + attr_reader entities: ::Hash[Symbol, top]? def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -109,6 +143,10 @@ module XTwitterScraper def is_reply=: (bool) -> bool + attr_reader is_translatable: bool? + + def is_translatable=: (bool) -> bool + attr_reader lang: String? def lang=: (String) -> String @@ -119,6 +157,28 @@ module XTwitterScraper ::Array[XTwitterScraper::TweetMedia] ) -> ::Array[XTwitterScraper::TweetMedia] + attr_reader note_tweet: XTwitterScraper::SearchTweet::NoteTweet? + + def note_tweet=: ( + XTwitterScraper::SearchTweet::NoteTweet + ) -> XTwitterScraper::SearchTweet::NoteTweet + + attr_reader place: XTwitterScraper::SearchTweet::Place? + + def place=: ( + XTwitterScraper::SearchTweet::Place + ) -> XTwitterScraper::SearchTweet::Place + + attr_reader possibly_sensitive: bool? + + def possibly_sensitive=: (bool) -> bool + + attr_reader previous_counts: XTwitterScraper::SearchTweet::PreviousCounts? + + def previous_counts=: ( + XTwitterScraper::SearchTweet::PreviousCounts + ) -> XTwitterScraper::SearchTweet::PreviousCounts + attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? def quoted_tweet=: ( @@ -143,6 +203,10 @@ module XTwitterScraper def url=: (String) -> String + attr_reader view_state: String? + + def view_state=: (String) -> String + def initialize: ( id: String, bookmark_count: Integer, @@ -152,11 +216,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + ?article: XTwitterScraper::SearchTweet::Article, ?author: XTwitterScraper::UserProfile, + ?card: XTwitterScraper::SearchTweet::Card, + ?community_note: XTwitterScraper::SearchTweet::CommunityNote, ?content_disclosure: XTwitterScraper::ContentDisclosure, ?conversation_id: String, ?created_at: String, ?display_text_range: ::Array[Integer], + ?edit: XTwitterScraper::SearchTweet::Edit, ?entities: ::Hash[Symbol, top], ?in_reply_to_id: String, ?in_reply_to_user_id: String, @@ -165,13 +233,19 @@ module XTwitterScraper ?is_note_tweet: bool, ?is_quote_status: bool, ?is_reply: bool, + ?is_translatable: bool, ?lang: String, ?media: ::Array[XTwitterScraper::TweetMedia], + ?note_tweet: XTwitterScraper::SearchTweet::NoteTweet, + ?place: XTwitterScraper::SearchTweet::Place, + ?possibly_sensitive: bool, + ?previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, ?quoted_tweet: XTwitterScraper::EmbeddedTweet, ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, ?source: String, ?type: String, - ?url: String + ?url: String, + ?view_state: String ) -> void def to_hash: -> { @@ -183,11 +257,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::SearchTweet::Article, author: XTwitterScraper::UserProfile, + card: XTwitterScraper::SearchTweet::Card, + community_note: XTwitterScraper::SearchTweet::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: ::Array[Integer], + edit: XTwitterScraper::SearchTweet::Edit, entities: ::Hash[Symbol, top], in_reply_to_id: String, in_reply_to_user_id: String, @@ -196,14 +274,369 @@ module XTwitterScraper is_note_tweet: bool, is_quote_status: bool, is_reply: bool, + is_translatable: bool, lang: String, media: ::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::SearchTweet::NoteTweet, + place: XTwitterScraper::SearchTweet::Place, + possibly_sensitive: bool, + previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, quoted_tweet: XTwitterScraper::EmbeddedTweet, retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } + + type article = + { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + + class Article < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader cover_media_url: String? + + def cover_media_url=: (String) -> String + + attr_reader preview_text: String? + + def preview_text=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + ?id: String, + ?cover_media_url: String, + ?preview_text: String, + ?title: String + ) -> void + + def to_hash: -> { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + end + + type card = + { + id: String, + binding_values: ::Hash[Symbol, top], + name: String, + url: String + } + + class Card < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader binding_values: ::Hash[Symbol, top]? + + def binding_values=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?id: String, + ?binding_values: ::Hash[Symbol, top], + ?name: String, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + binding_values: ::Hash[Symbol, top], + name: String, + url: String + } + end + + type community_note = + { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader destination_url: String? + + def destination_url=: (String) -> String + + attr_reader footer: String? + + def footer=: (String) -> String + + attr_reader short_title: String? + + def short_title=: (String) -> String + + attr_reader subtitle: String? + + def subtitle=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + attr_reader visual_style: String? + + def visual_style=: (String) -> String + + def initialize: ( + ?id: String, + ?destination_url: String, + ?footer: String, + ?short_title: String, + ?subtitle: String, + ?title: String, + ?visual_style: String + ) -> void + + def to_hash: -> { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + end + + type edit = + { editable_until_msecs: String, edit_tweet_ids: ::Array[String] } + + class Edit < XTwitterScraper::Internal::Type::BaseModel + attr_reader editable_until_msecs: String? + + def editable_until_msecs=: (String) -> String + + attr_reader edit_tweet_ids: ::Array[String]? + + def edit_tweet_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?editable_until_msecs: String, + ?edit_tweet_ids: ::Array[String] + ) -> void + + def to_hash: -> { + editable_until_msecs: String, + edit_tweet_ids: ::Array[String] + } + end + + type note_tweet = + { + text: String, + id: String, + entities: ::Hash[Symbol, top], + is_expandable: bool, + richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + } + + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + attr_accessor text: String + + attr_reader id: String? + + def id=: (String) -> String + + attr_reader entities: ::Hash[Symbol, top]? + + def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader is_expandable: bool? + + def is_expandable=: (bool) -> bool + + attr_reader richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag]? + + def richtext_tags=: ( + ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + ) -> ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + + def initialize: ( + text: String, + ?id: String, + ?entities: ::Hash[Symbol, top], + ?is_expandable: bool, + ?richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + ) -> void + + def to_hash: -> { + text: String, + id: String, + entities: ::Hash[Symbol, top], + is_expandable: bool, + richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] + } + + type richtext_tag = + { from_index: Integer, to_index: Integer, types: ::Array[String] } + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + attr_accessor from_index: Integer + + attr_accessor to_index: Integer + + attr_accessor types: ::Array[String] + + def initialize: ( + from_index: Integer, + to_index: Integer, + types: ::Array[String] + ) -> void + + def to_hash: -> { + from_index: Integer, + to_index: Integer, + types: ::Array[String] + } + end + end + + type place = + { + id: String, + bounding_box: ::Hash[Symbol, top], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + + class Place < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader bounding_box: ::Hash[Symbol, top]? + + def bounding_box=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader country_code: String? + + def country_code=: (String) -> String + + attr_reader full_name: String? + + def full_name=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader place_type: String? + + def place_type=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?id: String, + ?bounding_box: ::Hash[Symbol, top], + ?country: String, + ?country_code: String, + ?full_name: String, + ?name: String, + ?place_type: String, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + bounding_box: ::Hash[Symbol, top], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + end + + type previous_counts = + { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + attr_reader bookmark_count: Integer? + + def bookmark_count=: (Integer) -> Integer + + attr_reader like_count: Integer? + + def like_count=: (Integer) -> Integer + + attr_reader quote_count: Integer? + + def quote_count=: (Integer) -> Integer + + attr_reader reply_count: Integer? + + def reply_count=: (Integer) -> Integer + + attr_reader retweet_count: Integer? + + def retweet_count=: (Integer) -> Integer + + def initialize: ( + ?bookmark_count: Integer, + ?like_count: Integer, + ?quote_count: Integer, + ?reply_count: Integer, + ?retweet_count: Integer + ) -> void + + def to_hash: -> { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + end end end end diff --git a/sig/x_twitter_scraper/models/support/ticket_list_response.rbs b/sig/x_twitter_scraper/models/support/ticket_list_response.rbs index 768b4a2..5859cfa 100644 --- a/sig/x_twitter_scraper/models/support/ticket_list_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_list_response.rbs @@ -11,14 +11,10 @@ module XTwitterScraper } class TicketListResponse < XTwitterScraper::Internal::Type::BaseModel - attr_reader tickets: ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket]? - - def tickets=: ( - ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket] - ) -> ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket] + attr_accessor tickets: ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket] def initialize: ( - ?tickets: ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket] + tickets: ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket] ) -> void def to_hash: -> { @@ -30,53 +26,54 @@ module XTwitterScraper created_at: Time, message_count: Integer, public_id: String, - status: String, + status: XTwitterScraper::Models::Support::TicketListResponse::Ticket::status, subject: String, updated_at: Time } class Ticket < XTwitterScraper::Internal::Type::BaseModel - attr_reader created_at: Time? - - def created_at=: (Time) -> Time - - attr_reader message_count: Integer? - - def message_count=: (Integer) -> Integer + attr_accessor created_at: Time - attr_reader public_id: String? + attr_accessor message_count: Integer - def public_id=: (String) -> String + attr_accessor public_id: String - attr_reader status: String? + attr_accessor status: XTwitterScraper::Models::Support::TicketListResponse::Ticket::status - def status=: (String) -> String + attr_accessor subject: String - attr_reader subject: String? - - def subject=: (String) -> String - - attr_reader updated_at: Time? - - def updated_at=: (Time) -> Time + attr_accessor updated_at: Time def initialize: ( - ?created_at: Time, - ?message_count: Integer, - ?public_id: String, - ?status: String, - ?subject: String, - ?updated_at: Time + created_at: Time, + message_count: Integer, + public_id: String, + status: XTwitterScraper::Models::Support::TicketListResponse::Ticket::status, + subject: String, + updated_at: Time ) -> void def to_hash: -> { created_at: Time, message_count: Integer, public_id: String, - status: String, + status: XTwitterScraper::Models::Support::TicketListResponse::Ticket::status, subject: String, updated_at: Time } + + type status = :open | :in_progress | :resolved | :closed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + OPEN: :open + IN_PROGRESS: :in_progress + RESOLVED: :resolved + CLOSED: :closed + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketListResponse::Ticket::status] + end end end end diff --git a/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs b/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs index 63e71dc..bbbca8f 100644 --- a/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs @@ -10,52 +10,38 @@ module XTwitterScraper created_at: Time, messages: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message], public_id: String, - status: String, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::status, subject: String, updated_at: Time } class TicketRetrieveResponse < XTwitterScraper::Internal::Type::BaseModel - attr_reader created_at: Time? + attr_accessor created_at: Time - def created_at=: (Time) -> Time + attr_accessor messages: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message] - attr_reader messages: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message]? + attr_accessor public_id: String - def messages=: ( - ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message] - ) -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message] + attr_accessor status: XTwitterScraper::Models::Support::TicketRetrieveResponse::status - attr_reader public_id: String? + attr_accessor subject: String - def public_id=: (String) -> String - - attr_reader status: String? - - def status=: (String) -> String - - attr_reader subject: String? - - def subject=: (String) -> String - - attr_reader updated_at: Time? - - def updated_at=: (Time) -> Time + attr_accessor updated_at: Time def initialize: ( - ?created_at: Time, - ?messages: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message], - ?public_id: String, - ?status: String, - ?subject: String, - ?updated_at: Time + created_at: Time, + messages: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message], + public_id: String, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::status, + subject: String, + updated_at: Time ) -> void def to_hash: -> { created_at: Time, messages: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message], public_id: String, - status: String, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::status, subject: String, updated_at: Time } @@ -65,40 +51,30 @@ module XTwitterScraper attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], body: String, created_at: Time, - sender: String + sender: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::sender } class Message < XTwitterScraper::Internal::Type::BaseModel - attr_reader attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment]? - - def attachments=: ( - ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] - ) -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] - - attr_reader body: String? - - def body=: (String) -> String + attr_accessor attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment] - attr_reader created_at: Time? + attr_accessor body: String - def created_at=: (Time) -> Time + attr_accessor created_at: Time - attr_reader sender: String? - - def sender=: (String) -> String + attr_accessor sender: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::sender def initialize: ( - ?attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], - ?body: String, - ?created_at: Time, - ?sender: String + attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], + body: String, + created_at: Time, + sender: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::sender ) -> void def to_hash: -> { attachments: ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment], body: String, created_at: Time, - sender: String + sender: XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::sender } type attachment = @@ -193,6 +169,31 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::Attachment::status] end end + + type sender = :user | :support | :system + + module Sender + extend XTwitterScraper::Internal::Type::Enum + + USER: :user + SUPPORT: :support + SYSTEM: :system + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message::sender] + end + end + + type status = :open | :in_progress | :resolved | :closed + + module Status + extend XTwitterScraper::Internal::Type::Enum + + OPEN: :open + IN_PROGRESS: :in_progress + RESOLVED: :resolved + CLOSED: :closed + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketRetrieveResponse::status] end end end diff --git a/sig/x_twitter_scraper/models/support/ticket_update_response.rbs b/sig/x_twitter_scraper/models/support/ticket_update_response.rbs index 776cfad..2169e31 100644 --- a/sig/x_twitter_scraper/models/support/ticket_update_response.rbs +++ b/sig/x_twitter_scraper/models/support/ticket_update_response.rbs @@ -5,20 +5,38 @@ module XTwitterScraper module Models module Support - type ticket_update_response = { public_id: String, status: String } + type ticket_update_response = + { + public_id: String, + status: XTwitterScraper::Models::Support::TicketUpdateResponse::status + } class TicketUpdateResponse < XTwitterScraper::Internal::Type::BaseModel - attr_reader public_id: String? + attr_accessor public_id: String - def public_id=: (String) -> String + attr_accessor status: XTwitterScraper::Models::Support::TicketUpdateResponse::status - attr_reader status: String? + def initialize: ( + public_id: String, + status: XTwitterScraper::Models::Support::TicketUpdateResponse::status + ) -> void - def status=: (String) -> String + def to_hash: -> { + public_id: String, + status: XTwitterScraper::Models::Support::TicketUpdateResponse::status + } - def initialize: (?public_id: String, ?status: String) -> void + type status = :open | :resolved | :closed - def to_hash: -> { public_id: String, status: String } + module Status + extend XTwitterScraper::Internal::Type::Enum + + OPEN: :open + RESOLVED: :resolved + CLOSED: :closed + + def self?.values: -> ::Array[XTwitterScraper::Models::Support::TicketUpdateResponse::status] + end end end end diff --git a/sig/x_twitter_scraper/models/trend_list_response.rbs b/sig/x_twitter_scraper/models/trend_list_response.rbs index 12d6f43..95194a1 100644 --- a/sig/x_twitter_scraper/models/trend_list_response.rbs +++ b/sig/x_twitter_scraper/models/trend_list_response.rbs @@ -31,7 +31,15 @@ module XTwitterScraper } type trend = - { name: String, description: String, query: String, rank: Integer } + { + name: String, + description: String, + promoted_content: String?, + query: String, + rank: Integer, + tweet_volume: Integer?, + url: String + } class Trend < XTwitterScraper::Internal::Type::BaseModel attr_accessor name: String @@ -40,6 +48,8 @@ module XTwitterScraper def description=: (String) -> String + attr_accessor promoted_content: String? + attr_reader query: String? def query=: (String) -> String @@ -48,18 +58,30 @@ module XTwitterScraper def rank=: (Integer) -> Integer + attr_accessor tweet_volume: Integer? + + attr_reader url: String? + + def url=: (String) -> String + def initialize: ( name: String, ?description: String, + ?promoted_content: String?, ?query: String, - ?rank: Integer + ?rank: Integer, + ?tweet_volume: Integer?, + ?url: String ) -> void def to_hash: -> { name: String, description: String, + promoted_content: String?, query: String, - rank: Integer + rank: Integer, + tweet_volume: Integer?, + url: String } end end diff --git a/sig/x_twitter_scraper/models/tweet_media.rbs b/sig/x_twitter_scraper/models/tweet_media.rbs index a87382d..27ea6ce 100644 --- a/sig/x_twitter_scraper/models/tweet_media.rbs +++ b/sig/x_twitter_scraper/models/tweet_media.rbs @@ -9,7 +9,23 @@ module XTwitterScraper media_url: String, type: XTwitterScraper::Models::TweetMedia::type_, url: String, - video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant] + id: String, + allow_download: bool, + alt_text: String, + aspect_ratio: ::Array[Integer], + availability_status: String, + display_url: String, + duration_millis: Integer, + expanded_url: String, + face_rects: ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]], + focus_rects: ::Array[XTwitterScraper::TweetMedia::FocusRect], + height: Integer, + indices: ::Array[Integer], + media_key: String, + monetizable: bool, + sizes: ::Hash[Symbol, XTwitterScraper::TweetMedia::Size], + video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant], + width: Integer } class TweetMedia < XTwitterScraper::Internal::Type::BaseModel @@ -19,24 +35,126 @@ module XTwitterScraper attr_accessor url: String + attr_reader id: String? + + def id=: (String) -> String + + attr_reader allow_download: bool? + + def allow_download=: (bool) -> bool + + attr_reader alt_text: String? + + def alt_text=: (String) -> String + + attr_reader aspect_ratio: ::Array[Integer]? + + def aspect_ratio=: (::Array[Integer]) -> ::Array[Integer] + + attr_reader availability_status: String? + + def availability_status=: (String) -> String + + attr_reader display_url: String? + + def display_url=: (String) -> String + + attr_reader duration_millis: Integer? + + def duration_millis=: (Integer) -> Integer + + attr_reader expanded_url: String? + + def expanded_url=: (String) -> String + + attr_reader face_rects: ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]]? + + def face_rects=: ( + ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]] + ) -> ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]] + + attr_reader focus_rects: ::Array[XTwitterScraper::TweetMedia::FocusRect]? + + def focus_rects=: ( + ::Array[XTwitterScraper::TweetMedia::FocusRect] + ) -> ::Array[XTwitterScraper::TweetMedia::FocusRect] + + attr_reader height: Integer? + + def height=: (Integer) -> Integer + + attr_reader indices: ::Array[Integer]? + + def indices=: (::Array[Integer]) -> ::Array[Integer] + + attr_reader media_key: String? + + def media_key=: (String) -> String + + attr_reader monetizable: bool? + + def monetizable=: (bool) -> bool + + attr_reader sizes: ::Hash[Symbol, XTwitterScraper::TweetMedia::Size]? + + def sizes=: ( + ::Hash[Symbol, XTwitterScraper::TweetMedia::Size] + ) -> ::Hash[Symbol, XTwitterScraper::TweetMedia::Size] + attr_reader video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant]? def video_variants=: ( ::Array[XTwitterScraper::TweetMedia::VideoVariant] ) -> ::Array[XTwitterScraper::TweetMedia::VideoVariant] + attr_reader width: Integer? + + def width=: (Integer) -> Integer + def initialize: ( media_url: String, type: XTwitterScraper::Models::TweetMedia::type_, url: String, - ?video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant] + ?id: String, + ?allow_download: bool, + ?alt_text: String, + ?aspect_ratio: ::Array[Integer], + ?availability_status: String, + ?display_url: String, + ?duration_millis: Integer, + ?expanded_url: String, + ?face_rects: ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]], + ?focus_rects: ::Array[XTwitterScraper::TweetMedia::FocusRect], + ?height: Integer, + ?indices: ::Array[Integer], + ?media_key: String, + ?monetizable: bool, + ?sizes: ::Hash[Symbol, XTwitterScraper::TweetMedia::Size], + ?video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant], + ?width: Integer ) -> void def to_hash: -> { media_url: String, type: XTwitterScraper::Models::TweetMedia::type_, url: String, - video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant] + id: String, + allow_download: bool, + alt_text: String, + aspect_ratio: ::Array[Integer], + availability_status: String, + display_url: String, + duration_millis: Integer, + expanded_url: String, + face_rects: ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]], + focus_rects: ::Array[XTwitterScraper::TweetMedia::FocusRect], + height: Integer, + indices: ::Array[Integer], + media_key: String, + monetizable: bool, + sizes: ::Hash[Symbol, XTwitterScraper::TweetMedia::Size], + video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant], + width: Integer } type type_ = :photo | :video | :animated_gif @@ -51,6 +169,62 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::TweetMedia::type_] end + type face_rect = { h: Integer, w: Integer, x: Integer, y_: Integer } + + class FaceRect < XTwitterScraper::Internal::Type::BaseModel + attr_accessor h: Integer + + attr_accessor w: Integer + + attr_accessor x: Integer + + attr_accessor y_: Integer + + def initialize: ( + h: Integer, + w: Integer, + x: Integer, + y_: Integer + ) -> void + + def to_hash: -> { h: Integer, w: Integer, x: Integer, y_: Integer } + end + + type focus_rect = { h: Integer, w: Integer, x: Integer, y_: Integer } + + class FocusRect < XTwitterScraper::Internal::Type::BaseModel + attr_accessor h: Integer + + attr_accessor w: Integer + + attr_accessor x: Integer + + attr_accessor y_: Integer + + def initialize: ( + h: Integer, + w: Integer, + x: Integer, + y_: Integer + ) -> void + + def to_hash: -> { h: Integer, w: Integer, x: Integer, y_: Integer } + end + + type size = { h: Integer, resize: String, w: Integer } + + class Size < XTwitterScraper::Internal::Type::BaseModel + attr_accessor h: Integer + + attr_accessor resize: String + + attr_accessor w: Integer + + def initialize: (h: Integer, resize: String, w: Integer) -> void + + def to_hash: -> { h: Integer, resize: String, w: Integer } + end + type video_variant = { content_type: String, url: String, bitrate: Integer } diff --git a/sig/x_twitter_scraper/models/user_profile.rbs b/sig/x_twitter_scraper/models/user_profile.rbs index f63589c..0371099 100644 --- a/sig/x_twitter_scraper/models/user_profile.rbs +++ b/sig/x_twitter_scraper/models/user_profile.rbs @@ -9,36 +9,48 @@ module XTwitterScraper id: String, name: String, username: String, + affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, automated_by: String, - can_dm: bool, + business_account_affiliates_count: Integer, community_role: String, cover_picture: String, created_at: String, + creator_subscriptions_count: Integer, description: String, favourites_count: Integer, followers: Integer, following: Integer, has_custom_timelines: bool, + has_graduated_access: bool, + has_hidden_subscriptions_on_profile: bool, + highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, + identity_verification: XTwitterScraper::UserProfile::IdentityVerification, is_automated: bool, is_blue_verified: bool, + is_profile_translatable: bool, is_translator: bool, is_verified: bool, location: String, media_count: Integer, + parody_commentary_fan_label: String, pinned_tweet_ids: ::Array[String], possibly_sensitive: bool, profile_bio: ::Hash[Symbol, top], profile_banner_url: String, + profile_description_language: String, + profile_image_shape: String, + profile_interstitial_type: String, profile_picture: String, + profile_sort_enabled: bool, + profile_translator_type: String, protected: bool, statuses_count: Integer, + super_follow_eligible: bool, unavailable: bool, unavailable_reason: String, url: String, verified: bool, verified_type: String, - viewer_followed_by: bool, - viewer_following: bool, withheld_in_countries: ::Array[String] } @@ -49,13 +61,19 @@ module XTwitterScraper attr_accessor username: String + attr_reader affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel? + + def affiliates_highlighted_label=: ( + XTwitterScraper::UserProfile::AffiliatesHighlightedLabel + ) -> XTwitterScraper::UserProfile::AffiliatesHighlightedLabel + attr_reader automated_by: String? def automated_by=: (String) -> String - attr_reader can_dm: bool? + attr_reader business_account_affiliates_count: Integer? - def can_dm=: (bool) -> bool + def business_account_affiliates_count=: (Integer) -> Integer attr_reader community_role: String? @@ -69,6 +87,10 @@ module XTwitterScraper def created_at=: (String) -> String + attr_reader creator_subscriptions_count: Integer? + + def creator_subscriptions_count=: (Integer) -> Integer + attr_reader description: String? def description=: (String) -> String @@ -89,6 +111,26 @@ module XTwitterScraper def has_custom_timelines=: (bool) -> bool + attr_reader has_graduated_access: bool? + + def has_graduated_access=: (bool) -> bool + + attr_reader has_hidden_subscriptions_on_profile: bool? + + def has_hidden_subscriptions_on_profile=: (bool) -> bool + + attr_reader highlights_info: XTwitterScraper::UserProfile::HighlightsInfo? + + def highlights_info=: ( + XTwitterScraper::UserProfile::HighlightsInfo + ) -> XTwitterScraper::UserProfile::HighlightsInfo + + attr_reader identity_verification: XTwitterScraper::UserProfile::IdentityVerification? + + def identity_verification=: ( + XTwitterScraper::UserProfile::IdentityVerification + ) -> XTwitterScraper::UserProfile::IdentityVerification + attr_reader is_automated: bool? def is_automated=: (bool) -> bool @@ -97,6 +139,10 @@ module XTwitterScraper def is_blue_verified=: (bool) -> bool + attr_reader is_profile_translatable: bool? + + def is_profile_translatable=: (bool) -> bool + attr_reader is_translator: bool? def is_translator=: (bool) -> bool @@ -113,6 +159,10 @@ module XTwitterScraper def media_count=: (Integer) -> Integer + attr_reader parody_commentary_fan_label: String? + + def parody_commentary_fan_label=: (String) -> String + attr_reader pinned_tweet_ids: ::Array[String]? def pinned_tweet_ids=: (::Array[String]) -> ::Array[String] @@ -129,10 +179,30 @@ module XTwitterScraper def profile_banner_url=: (String) -> String + attr_reader profile_description_language: String? + + def profile_description_language=: (String) -> String + + attr_reader profile_image_shape: String? + + def profile_image_shape=: (String) -> String + + attr_reader profile_interstitial_type: String? + + def profile_interstitial_type=: (String) -> String + attr_reader profile_picture: String? def profile_picture=: (String) -> String + attr_reader profile_sort_enabled: bool? + + def profile_sort_enabled=: (bool) -> bool + + attr_reader profile_translator_type: String? + + def profile_translator_type=: (String) -> String + attr_reader protected: bool? def protected=: (bool) -> bool @@ -141,6 +211,10 @@ module XTwitterScraper def statuses_count=: (Integer) -> Integer + attr_reader super_follow_eligible: bool? + + def super_follow_eligible=: (bool) -> bool + attr_reader unavailable: bool? def unavailable=: (bool) -> bool @@ -161,14 +235,6 @@ module XTwitterScraper def verified_type=: (String) -> String - attr_reader viewer_followed_by: bool? - - def viewer_followed_by=: (bool) -> bool - - attr_reader viewer_following: bool? - - def viewer_following=: (bool) -> bool - attr_reader withheld_in_countries: ::Array[String]? def withheld_in_countries=: (::Array[String]) -> ::Array[String] @@ -177,36 +243,48 @@ module XTwitterScraper id: String, name: String, username: String, + ?affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, ?automated_by: String, - ?can_dm: bool, + ?business_account_affiliates_count: Integer, ?community_role: String, ?cover_picture: String, ?created_at: String, + ?creator_subscriptions_count: Integer, ?description: String, ?favourites_count: Integer, ?followers: Integer, ?following: Integer, ?has_custom_timelines: bool, + ?has_graduated_access: bool, + ?has_hidden_subscriptions_on_profile: bool, + ?highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, + ?identity_verification: XTwitterScraper::UserProfile::IdentityVerification, ?is_automated: bool, ?is_blue_verified: bool, + ?is_profile_translatable: bool, ?is_translator: bool, ?is_verified: bool, ?location: String, ?media_count: Integer, + ?parody_commentary_fan_label: String, ?pinned_tweet_ids: ::Array[String], ?possibly_sensitive: bool, ?profile_bio: ::Hash[Symbol, top], ?profile_banner_url: String, + ?profile_description_language: String, + ?profile_image_shape: String, + ?profile_interstitial_type: String, ?profile_picture: String, + ?profile_sort_enabled: bool, + ?profile_translator_type: String, ?protected: bool, ?statuses_count: Integer, + ?super_follow_eligible: bool, ?unavailable: bool, ?unavailable_reason: String, ?url: String, ?verified: bool, ?verified_type: String, - ?viewer_followed_by: bool, - ?viewer_following: bool, ?withheld_in_countries: ::Array[String] ) -> void @@ -214,38 +292,160 @@ module XTwitterScraper id: String, name: String, username: String, + affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, automated_by: String, - can_dm: bool, + business_account_affiliates_count: Integer, community_role: String, cover_picture: String, created_at: String, + creator_subscriptions_count: Integer, description: String, favourites_count: Integer, followers: Integer, following: Integer, has_custom_timelines: bool, + has_graduated_access: bool, + has_hidden_subscriptions_on_profile: bool, + highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, + identity_verification: XTwitterScraper::UserProfile::IdentityVerification, is_automated: bool, is_blue_verified: bool, + is_profile_translatable: bool, is_translator: bool, is_verified: bool, location: String, media_count: Integer, + parody_commentary_fan_label: String, pinned_tweet_ids: ::Array[String], possibly_sensitive: bool, profile_bio: ::Hash[Symbol, top], profile_banner_url: String, + profile_description_language: String, + profile_image_shape: String, + profile_interstitial_type: String, profile_picture: String, + profile_sort_enabled: bool, + profile_translator_type: String, protected: bool, statuses_count: Integer, + super_follow_eligible: bool, unavailable: bool, unavailable_reason: String, url: String, verified: bool, verified_type: String, - viewer_followed_by: bool, - viewer_following: bool, withheld_in_countries: ::Array[String] } + + type affiliates_highlighted_label = + { + badge_url: String, + description: String, + url: String, + url_type: String, + user_label_display_type: String, + user_label_type: String + } + + class AffiliatesHighlightedLabel < XTwitterScraper::Internal::Type::BaseModel + attr_reader badge_url: String? + + def badge_url=: (String) -> String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + attr_reader url_type: String? + + def url_type=: (String) -> String + + attr_reader user_label_display_type: String? + + def user_label_display_type=: (String) -> String + + attr_reader user_label_type: String? + + def user_label_type=: (String) -> String + + def initialize: ( + ?badge_url: String, + ?description: String, + ?url: String, + ?url_type: String, + ?user_label_display_type: String, + ?user_label_type: String + ) -> void + + def to_hash: -> { + badge_url: String, + description: String, + url: String, + url_type: String, + user_label_display_type: String, + user_label_type: String + } + end + + type highlights_info = + { can_highlight_tweets: bool, highlighted_tweets: String } + + class HighlightsInfo < XTwitterScraper::Internal::Type::BaseModel + attr_reader can_highlight_tweets: bool? + + def can_highlight_tweets=: (bool) -> bool + + attr_reader highlighted_tweets: String? + + def highlighted_tweets=: (String) -> String + + def initialize: ( + ?can_highlight_tweets: bool, + ?highlighted_tweets: String + ) -> void + + def to_hash: -> { + can_highlight_tweets: bool, + highlighted_tweets: String + } + end + + type identity_verification = + { + description: String, + is_identity_verified: bool, + verified_since_msec: String + } + + class IdentityVerification < XTwitterScraper::Internal::Type::BaseModel + attr_reader description: String? + + def description=: (String) -> String + + attr_reader is_identity_verified: bool? + + def is_identity_verified=: (bool) -> bool + + attr_reader verified_since_msec: String? + + def verified_since_msec=: (String) -> String + + def initialize: ( + ?description: String, + ?is_identity_verified: bool, + ?verified_since_msec: String + ) -> void + + def to_hash: -> { + description: String, + is_identity_verified: bool, + verified_since_msec: String + } + end end end end diff --git a/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs index 06ceb79..704f9ee 100644 --- a/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs @@ -2,15 +2,15 @@ module XTwitterScraper module Models module X type account_connection_attempt_retrieve_response = - XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending - | XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess - | XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed - | XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge + XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending + | XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success + | XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed + | XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode module AccountConnectionAttemptRetrieveResponse extend XTwitterScraper::Internal::Type::Union - type x_account_connection_attempt_pending = + type pending = { id: String, object: :x_account_connection_attempt, @@ -18,7 +18,7 @@ module XTwitterScraper status: :pending } - class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel + class Pending < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String attr_accessor object: :x_account_connection_attempt @@ -42,14 +42,14 @@ module XTwitterScraper } end - type x_account_connection_attempt_success = + type success = { id: String, object: :x_account_connection_attempt, status: :success } - class XAccountConnectionAttemptSuccess < XTwitterScraper::Internal::Type::BaseModel + class Success < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String attr_accessor object: :x_account_connection_attempt @@ -69,7 +69,7 @@ module XTwitterScraper } end - type x_account_connection_attempt_failed = + type failed = { id: String, error: String, @@ -79,7 +79,7 @@ module XTwitterScraper reason: String } - class XAccountConnectionAttemptFailed < XTwitterScraper::Internal::Type::BaseModel + class Failed < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String attr_accessor error: String @@ -113,26 +113,26 @@ module XTwitterScraper } end - type x_account_connection_challenge = + type requires_email_code = { id: String, expires_at: Time, message: String, - object: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::object, - status: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::status, + object: :x_account_connection_challenge, + status: :requires_email_code, username: String } - class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel + class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String attr_accessor expires_at: Time attr_accessor message: String - attr_accessor object: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::object + attr_accessor object: :x_account_connection_challenge - attr_accessor status: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::status + attr_accessor status: :requires_email_code attr_accessor username: String @@ -140,39 +140,19 @@ module XTwitterScraper id: String, expires_at: Time, message: String, - object: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::object, - status: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::status, - username: String + username: String, + ?object: :x_account_connection_challenge, + ?status: :requires_email_code ) -> void def to_hash: -> { id: String, expires_at: Time, message: String, - object: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::object, - status: XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::status, + object: :x_account_connection_challenge, + status: :requires_email_code, username: String } - - type object = :x_account_connection_challenge - - module Object - extend XTwitterScraper::Internal::Type::Enum - - X_ACCOUNT_CONNECTION_CHALLENGE: :x_account_connection_challenge - - def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::object] - end - - type status = :requires_email_code - - module Status - extend XTwitterScraper::Internal::Type::Enum - - REQUIRES_EMAIL_CODE: :requires_email_code - - def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge::status] - end end def self?.variants: -> ::Array[XTwitterScraper::Models::X::account_connection_attempt_retrieve_response] diff --git a/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs b/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs index a6a4aa9..64ca2a4 100644 --- a/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs @@ -10,7 +10,7 @@ module XTwitterScraper id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health, - status: String, + status: :active, x_user_id: String, x_username: String } @@ -22,7 +22,7 @@ module XTwitterScraper attr_accessor health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health - attr_accessor status: String + attr_accessor status: :active attr_accessor x_user_id: String @@ -32,16 +32,16 @@ module XTwitterScraper id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health, - status: String, x_user_id: String, - x_username: String + x_username: String, + ?status: :active ) -> void def to_hash: -> { id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::health, - status: String, + status: :active, x_user_id: String, x_username: String } diff --git a/sig/x_twitter_scraper/models/x/account_create_response.rbs b/sig/x_twitter_scraper/models/x/account_create_response.rbs index 60ab61e..43e7fe5 100644 --- a/sig/x_twitter_scraper/models/x/account_create_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_create_response.rbs @@ -5,7 +5,153 @@ module XTwitterScraper module Models module X - AccountCreateResponse: XTwitterScraper::Internal::Type::Converter + type account_create_response = + XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount + | XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending + | XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge + + module AccountCreateResponse + extend XTwitterScraper::Internal::Type::Union + + type sanitized_x_account = + { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health, + status: :active, + x_user_id: String, + x_username: String + } + + class SanitizedXAccount < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health + + attr_accessor status: :active + + attr_accessor x_user_id: String + + attr_accessor x_username: String + + def initialize: ( + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health, + x_user_id: String, + x_username: String, + ?status: :active + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health, + status: :active, + x_user_id: String, + x_username: String + } + + type health = + :healthy + | :locked + | :needsReauth + | :recovering + | :suspended + | :temporaryIssue + + module Health + extend XTwitterScraper::Internal::Type::Enum + + HEALTHY: :healthy + LOCKED: :locked + NEEDS_REAUTH: :needsReauth + RECOVERING: :recovering + SUSPENDED: :suspended + TEMPORARY_ISSUE: :temporaryIssue + + def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health] + end + end + + type x_account_connection_attempt_pending = + { + id: String, + object: :x_account_connection_attempt, + poll_after_ms: Integer, + status: :pending + } + + class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor object: :x_account_connection_attempt + + attr_accessor poll_after_ms: Integer + + attr_accessor status: :pending + + def initialize: ( + id: String, + poll_after_ms: Integer, + ?object: :x_account_connection_attempt, + ?status: :pending + ) -> void + + def to_hash: -> { + id: String, + object: :x_account_connection_attempt, + poll_after_ms: Integer, + status: :pending + } + end + + type x_account_connection_challenge = + { + id: String, + expires_at: Time, + message: String, + object: :x_account_connection_challenge, + status: :requires_email_code, + username: String + } + + class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor expires_at: Time + + attr_accessor message: String + + attr_accessor object: :x_account_connection_challenge + + attr_accessor status: :requires_email_code + + attr_accessor username: String + + def initialize: ( + id: String, + expires_at: Time, + message: String, + username: String, + ?object: :x_account_connection_challenge, + ?status: :requires_email_code + ) -> void + + def to_hash: -> { + id: String, + expires_at: Time, + message: String, + object: :x_account_connection_challenge, + status: :requires_email_code, + username: String + } + end + + def self?.variants: -> ::Array[XTwitterScraper::Models::X::account_create_response] + end end end end diff --git a/sig/x_twitter_scraper/models/x/account_reauth_response.rbs b/sig/x_twitter_scraper/models/x/account_reauth_response.rbs index a2a32ef..a0e75a4 100644 --- a/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_reauth_response.rbs @@ -10,7 +10,7 @@ module XTwitterScraper id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::health, - status: String, + status: :active, x_user_id: String, x_username: String } @@ -22,7 +22,7 @@ module XTwitterScraper attr_accessor health: XTwitterScraper::Models::X::AccountReauthResponse::health - attr_accessor status: String + attr_accessor status: :active attr_accessor x_user_id: String @@ -32,16 +32,16 @@ module XTwitterScraper id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::health, - status: String, x_user_id: String, - x_username: String + x_username: String, + ?status: :active ) -> void def to_hash: -> { id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::health, - status: String, + status: :active, x_user_id: String, x_username: String } diff --git a/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs b/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs index a1da96e..aabaa06 100644 --- a/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +++ b/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs @@ -29,14 +29,12 @@ module XTwitterScraper creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, description: String, invites_policy: String, - is_member: bool, is_nsfw: bool, join_policy: String, member_count: Integer, moderator_count: Integer, name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, - role: String, rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } @@ -65,10 +63,6 @@ module XTwitterScraper def invites_policy=: (String) -> String - attr_reader is_member: bool? - - def is_member=: (bool) -> bool - attr_reader is_nsfw: bool? def is_nsfw=: (bool) -> bool @@ -95,10 +89,6 @@ module XTwitterScraper XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic ) -> XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic - attr_reader role: String? - - def role=: (String) -> String - attr_reader rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]? def rules=: ( @@ -112,14 +102,12 @@ module XTwitterScraper ?creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, ?description: String, ?invites_policy: String, - ?is_member: bool, ?is_nsfw: bool, ?join_policy: String, ?member_count: Integer, ?moderator_count: Integer, ?name: String, ?primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, - ?role: String, ?rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] ) -> void @@ -130,14 +118,12 @@ module XTwitterScraper creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator, description: String, invites_policy: String, - is_member: bool, is_nsfw: bool, join_policy: String, member_count: Integer, moderator_count: Integer, name: String, primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic, - role: String, rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule] } diff --git a/sig/x_twitter_scraper/models/x/tweet_author.rbs b/sig/x_twitter_scraper/models/x/tweet_author.rbs index 0e4513f..7c6ff93 100644 --- a/sig/x_twitter_scraper/models/x/tweet_author.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_author.rbs @@ -5,12 +5,20 @@ module XTwitterScraper module Models module X - type tweet_author = { } + type tweet_author = { followers: Integer, verified: bool } class TweetAuthor < XTwitterScraper::Models::UserProfile - def initialize: -> void + def followers: -> Integer - def to_hash: -> { } + def followers=: (Integer _) -> Integer + + def verified: -> bool + + def verified=: (bool _) -> bool + + def initialize: (followers: Integer, verified: bool) -> void + + def to_hash: -> { followers: Integer, verified: bool } end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_detail.rbs b/sig/x_twitter_scraper/models/x/tweet_detail.rbs index 449cee6..86e90c1 100644 --- a/sig/x_twitter_scraper/models/x/tweet_detail.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_detail.rbs @@ -15,11 +15,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::X::TweetDetail::Article, author: XTwitterScraper::X::TweetAuthor, + card: XTwitterScraper::X::TweetDetail::Card, + community_note: XTwitterScraper::X::TweetDetail::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: ::Array[Integer], + edit: XTwitterScraper::X::TweetDetail::Edit, entities: ::Hash[Symbol, top], in_reply_to_id: String, in_reply_to_user_id: String, @@ -28,13 +32,19 @@ module XTwitterScraper is_note_tweet: bool, is_quote_status: bool, is_reply: bool, + is_translatable: bool, lang: String, media: ::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, + place: XTwitterScraper::X::TweetDetail::Place, + possibly_sensitive: bool, + previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, quoted_tweet: XTwitterScraper::EmbeddedTweet, retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } class TweetDetail < XTwitterScraper::Internal::Type::BaseModel @@ -54,12 +64,30 @@ module XTwitterScraper attr_accessor view_count: Integer + attr_reader article: XTwitterScraper::X::TweetDetail::Article? + + def article=: ( + XTwitterScraper::X::TweetDetail::Article + ) -> XTwitterScraper::X::TweetDetail::Article + attr_reader author: XTwitterScraper::X::TweetAuthor? def author=: ( XTwitterScraper::X::TweetAuthor ) -> XTwitterScraper::X::TweetAuthor + attr_reader card: XTwitterScraper::X::TweetDetail::Card? + + def card=: ( + XTwitterScraper::X::TweetDetail::Card + ) -> XTwitterScraper::X::TweetDetail::Card + + attr_reader community_note: XTwitterScraper::X::TweetDetail::CommunityNote? + + def community_note=: ( + XTwitterScraper::X::TweetDetail::CommunityNote + ) -> XTwitterScraper::X::TweetDetail::CommunityNote + attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? def content_disclosure=: ( @@ -78,6 +106,12 @@ module XTwitterScraper def display_text_range=: (::Array[Integer]) -> ::Array[Integer] + attr_reader edit: XTwitterScraper::X::TweetDetail::Edit? + + def edit=: ( + XTwitterScraper::X::TweetDetail::Edit + ) -> XTwitterScraper::X::TweetDetail::Edit + attr_reader entities: ::Hash[Symbol, top]? def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] @@ -110,6 +144,10 @@ module XTwitterScraper def is_reply=: (bool) -> bool + attr_reader is_translatable: bool? + + def is_translatable=: (bool) -> bool + attr_reader lang: String? def lang=: (String) -> String @@ -120,6 +158,28 @@ module XTwitterScraper ::Array[XTwitterScraper::TweetMedia] ) -> ::Array[XTwitterScraper::TweetMedia] + attr_reader note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet? + + def note_tweet=: ( + XTwitterScraper::X::TweetDetail::NoteTweet + ) -> XTwitterScraper::X::TweetDetail::NoteTweet + + attr_reader place: XTwitterScraper::X::TweetDetail::Place? + + def place=: ( + XTwitterScraper::X::TweetDetail::Place + ) -> XTwitterScraper::X::TweetDetail::Place + + attr_reader possibly_sensitive: bool? + + def possibly_sensitive=: (bool) -> bool + + attr_reader previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts? + + def previous_counts=: ( + XTwitterScraper::X::TweetDetail::PreviousCounts + ) -> XTwitterScraper::X::TweetDetail::PreviousCounts + attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? def quoted_tweet=: ( @@ -144,6 +204,10 @@ module XTwitterScraper def url=: (String) -> String + attr_reader view_state: String? + + def view_state=: (String) -> String + def initialize: ( id: String, bookmark_count: Integer, @@ -153,11 +217,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + ?article: XTwitterScraper::X::TweetDetail::Article, ?author: XTwitterScraper::X::TweetAuthor, + ?card: XTwitterScraper::X::TweetDetail::Card, + ?community_note: XTwitterScraper::X::TweetDetail::CommunityNote, ?content_disclosure: XTwitterScraper::ContentDisclosure, ?conversation_id: String, ?created_at: String, ?display_text_range: ::Array[Integer], + ?edit: XTwitterScraper::X::TweetDetail::Edit, ?entities: ::Hash[Symbol, top], ?in_reply_to_id: String, ?in_reply_to_user_id: String, @@ -166,13 +234,19 @@ module XTwitterScraper ?is_note_tweet: bool, ?is_quote_status: bool, ?is_reply: bool, + ?is_translatable: bool, ?lang: String, ?media: ::Array[XTwitterScraper::TweetMedia], + ?note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, + ?place: XTwitterScraper::X::TweetDetail::Place, + ?possibly_sensitive: bool, + ?previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, ?quoted_tweet: XTwitterScraper::EmbeddedTweet, ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, ?source: String, ?type: String, - ?url: String + ?url: String, + ?view_state: String ) -> void def to_hash: -> { @@ -184,11 +258,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, + article: XTwitterScraper::X::TweetDetail::Article, author: XTwitterScraper::X::TweetAuthor, + card: XTwitterScraper::X::TweetDetail::Card, + community_note: XTwitterScraper::X::TweetDetail::CommunityNote, content_disclosure: XTwitterScraper::ContentDisclosure, conversation_id: String, created_at: String, display_text_range: ::Array[Integer], + edit: XTwitterScraper::X::TweetDetail::Edit, entities: ::Hash[Symbol, top], in_reply_to_id: String, in_reply_to_user_id: String, @@ -197,14 +275,369 @@ module XTwitterScraper is_note_tweet: bool, is_quote_status: bool, is_reply: bool, + is_translatable: bool, lang: String, media: ::Array[XTwitterScraper::TweetMedia], + note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, + place: XTwitterScraper::X::TweetDetail::Place, + possibly_sensitive: bool, + previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, quoted_tweet: XTwitterScraper::EmbeddedTweet, retweeted_tweet: XTwitterScraper::EmbeddedTweet, source: String, type: String, - url: String + url: String, + view_state: String } + + type article = + { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + + class Article < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader cover_media_url: String? + + def cover_media_url=: (String) -> String + + attr_reader preview_text: String? + + def preview_text=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + def initialize: ( + ?id: String, + ?cover_media_url: String, + ?preview_text: String, + ?title: String + ) -> void + + def to_hash: -> { + id: String, + cover_media_url: String, + preview_text: String, + title: String + } + end + + type card = + { + id: String, + binding_values: ::Hash[Symbol, top], + name: String, + url: String + } + + class Card < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader binding_values: ::Hash[Symbol, top]? + + def binding_values=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?id: String, + ?binding_values: ::Hash[Symbol, top], + ?name: String, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + binding_values: ::Hash[Symbol, top], + name: String, + url: String + } + end + + type community_note = + { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + + class CommunityNote < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader destination_url: String? + + def destination_url=: (String) -> String + + attr_reader footer: String? + + def footer=: (String) -> String + + attr_reader short_title: String? + + def short_title=: (String) -> String + + attr_reader subtitle: String? + + def subtitle=: (String) -> String + + attr_reader title: String? + + def title=: (String) -> String + + attr_reader visual_style: String? + + def visual_style=: (String) -> String + + def initialize: ( + ?id: String, + ?destination_url: String, + ?footer: String, + ?short_title: String, + ?subtitle: String, + ?title: String, + ?visual_style: String + ) -> void + + def to_hash: -> { + id: String, + destination_url: String, + footer: String, + short_title: String, + subtitle: String, + title: String, + visual_style: String + } + end + + type edit = + { editable_until_msecs: String, edit_tweet_ids: ::Array[String] } + + class Edit < XTwitterScraper::Internal::Type::BaseModel + attr_reader editable_until_msecs: String? + + def editable_until_msecs=: (String) -> String + + attr_reader edit_tweet_ids: ::Array[String]? + + def edit_tweet_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?editable_until_msecs: String, + ?edit_tweet_ids: ::Array[String] + ) -> void + + def to_hash: -> { + editable_until_msecs: String, + edit_tweet_ids: ::Array[String] + } + end + + type note_tweet = + { + text: String, + id: String, + entities: ::Hash[Symbol, top], + is_expandable: bool, + richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] + } + + class NoteTweet < XTwitterScraper::Internal::Type::BaseModel + attr_accessor text: String + + attr_reader id: String? + + def id=: (String) -> String + + attr_reader entities: ::Hash[Symbol, top]? + + def entities=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader is_expandable: bool? + + def is_expandable=: (bool) -> bool + + attr_reader richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag]? + + def richtext_tags=: ( + ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] + ) -> ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] + + def initialize: ( + text: String, + ?id: String, + ?entities: ::Hash[Symbol, top], + ?is_expandable: bool, + ?richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] + ) -> void + + def to_hash: -> { + text: String, + id: String, + entities: ::Hash[Symbol, top], + is_expandable: bool, + richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] + } + + type richtext_tag = + { from_index: Integer, to_index: Integer, types: ::Array[String] } + + class RichtextTag < XTwitterScraper::Internal::Type::BaseModel + attr_accessor from_index: Integer + + attr_accessor to_index: Integer + + attr_accessor types: ::Array[String] + + def initialize: ( + from_index: Integer, + to_index: Integer, + types: ::Array[String] + ) -> void + + def to_hash: -> { + from_index: Integer, + to_index: Integer, + types: ::Array[String] + } + end + end + + type place = + { + id: String, + bounding_box: ::Hash[Symbol, top], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + + class Place < XTwitterScraper::Internal::Type::BaseModel + attr_reader id: String? + + def id=: (String) -> String + + attr_reader bounding_box: ::Hash[Symbol, top]? + + def bounding_box=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader country_code: String? + + def country_code=: (String) -> String + + attr_reader full_name: String? + + def full_name=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader place_type: String? + + def place_type=: (String) -> String + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?id: String, + ?bounding_box: ::Hash[Symbol, top], + ?country: String, + ?country_code: String, + ?full_name: String, + ?name: String, + ?place_type: String, + ?url: String + ) -> void + + def to_hash: -> { + id: String, + bounding_box: ::Hash[Symbol, top], + country: String, + country_code: String, + full_name: String, + name: String, + place_type: String, + url: String + } + end + + type previous_counts = + { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + + class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel + attr_reader bookmark_count: Integer? + + def bookmark_count=: (Integer) -> Integer + + attr_reader like_count: Integer? + + def like_count=: (Integer) -> Integer + + attr_reader quote_count: Integer? + + def quote_count=: (Integer) -> Integer + + attr_reader reply_count: Integer? + + def reply_count=: (Integer) -> Integer + + attr_reader retweet_count: Integer? + + def retweet_count=: (Integer) -> Integer + + def initialize: ( + ?bookmark_count: Integer, + ?like_count: Integer, + ?quote_count: Integer, + ?reply_count: Integer, + ?retweet_count: Integer + ) -> void + + def to_hash: -> { + bookmark_count: Integer, + like_count: Integer, + quote_count: Integer, + reply_count: Integer, + retweet_count: Integer + } + end end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs b/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs index a58a7ef..6af80a2 100644 --- a/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs @@ -18,12 +18,14 @@ module XTwitterScraper hashtags: String, in_reply_to_tweet_id: String, language: String, + limit: Integer, media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, mentioning: String, min_faves: Integer, min_quotes: Integer, min_replies: Integer, min_retweets: Integer, + mode: XTwitterScraper::Models::X::TweetGetRepliesParams::mode, page_size: Integer, quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, quotes_of_tweet_id: String, @@ -86,6 +88,10 @@ module XTwitterScraper def language=: (String) -> String + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + attr_reader media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type? def media_type=: ( @@ -112,6 +118,12 @@ module XTwitterScraper def min_retweets=: (Integer) -> Integer + attr_reader mode: XTwitterScraper::Models::X::TweetGetRepliesParams::mode? + + def mode=: ( + XTwitterScraper::Models::X::TweetGetRepliesParams::mode + ) -> XTwitterScraper::Models::X::TweetGetRepliesParams::mode + attr_reader page_size: Integer? def page_size=: (Integer) -> Integer @@ -182,12 +194,14 @@ module XTwitterScraper ?hashtags: String, ?in_reply_to_tweet_id: String, ?language: String, + ?limit: Integer, ?media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, ?mentioning: String, ?min_faves: Integer, ?min_quotes: Integer, ?min_replies: Integer, ?min_retweets: Integer, + ?mode: XTwitterScraper::Models::X::TweetGetRepliesParams::mode, ?page_size: Integer, ?quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, ?quotes_of_tweet_id: String, @@ -216,12 +230,14 @@ module XTwitterScraper hashtags: String, in_reply_to_tweet_id: String, language: String, + limit: Integer, media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, mentioning: String, min_faves: Integer, min_quotes: Integer, min_replies: Integer, min_retweets: Integer, + mode: XTwitterScraper::Models::X::TweetGetRepliesParams::mode, page_size: Integer, quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, quotes_of_tweet_id: String, @@ -253,6 +269,16 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesParams::media_type] end + type mode = :complete + + module Mode + extend XTwitterScraper::Internal::Type::Enum + + COMPLETE: :complete + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesParams::mode] + end + type quotes = :include | :exclude | :only module Quotes diff --git a/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs b/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs new file mode 100644 index 0000000..f617500 --- /dev/null +++ b/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs @@ -0,0 +1,274 @@ +module XTwitterScraper + module Models + module X + type tweet_get_replies_response = + { + diagnostic: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic, + nested_replies: ::Array[XTwitterScraper::SearchTweet] + } + + class TweetGetRepliesResponse < XTwitterScraper::Models::PaginatedTweets + def diagnostic: -> XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic? + + def diagnostic=: ( + XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic _ + ) -> XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic + + def nested_replies: -> ::Array[XTwitterScraper::SearchTweet]? + + def nested_replies=: ( + ::Array[XTwitterScraper::SearchTweet] _ + ) -> ::Array[XTwitterScraper::SearchTweet] + + def initialize: ( + ?diagnostic: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic, + ?nested_replies: ::Array[XTwitterScraper::SearchTweet] + ) -> void + + def to_hash: -> { + diagnostic: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic, + nested_replies: ::Array[XTwitterScraper::SearchTweet] + } + + type diagnostic = + { + complete: bool, + coverage_percentage: Float, + cursor_failures: Integer, + duplicate_count: Integer, + empty_false_progress_pages: Integer, + malformed_count: Integer, + missing_response_modules_or_fields: ::Array[String], + nested_reply_count: Integer, + pages_attempted: Integer, + recommended_fallback: String, + repeated_cursor_count: Integer, + reported_reply_count: Integer, + response_truncated: bool, + richness: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness, + strategies_attempted: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted], + target_direct_replies: Integer, + unique_direct_replies: Integer, + unrelated_count: Integer + } + + class Diagnostic < XTwitterScraper::Internal::Type::BaseModel + attr_accessor complete: bool + + attr_accessor coverage_percentage: Float + + attr_accessor cursor_failures: Integer + + attr_accessor duplicate_count: Integer + + attr_accessor empty_false_progress_pages: Integer + + attr_accessor malformed_count: Integer + + attr_accessor missing_response_modules_or_fields: ::Array[String] + + attr_accessor nested_reply_count: Integer + + attr_accessor pages_attempted: Integer + + attr_accessor recommended_fallback: String + + attr_accessor repeated_cursor_count: Integer + + attr_accessor reported_reply_count: Integer + + attr_accessor response_truncated: bool + + attr_accessor richness: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness + + attr_accessor strategies_attempted: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted] + + attr_accessor target_direct_replies: Integer + + attr_accessor unique_direct_replies: Integer + + attr_accessor unrelated_count: Integer + + def initialize: ( + complete: bool, + coverage_percentage: Float, + cursor_failures: Integer, + duplicate_count: Integer, + empty_false_progress_pages: Integer, + malformed_count: Integer, + missing_response_modules_or_fields: ::Array[String], + nested_reply_count: Integer, + pages_attempted: Integer, + recommended_fallback: String, + repeated_cursor_count: Integer, + reported_reply_count: Integer, + response_truncated: bool, + richness: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness, + strategies_attempted: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted], + target_direct_replies: Integer, + unique_direct_replies: Integer, + unrelated_count: Integer + ) -> void + + def to_hash: -> { + complete: bool, + coverage_percentage: Float, + cursor_failures: Integer, + duplicate_count: Integer, + empty_false_progress_pages: Integer, + malformed_count: Integer, + missing_response_modules_or_fields: ::Array[String], + nested_reply_count: Integer, + pages_attempted: Integer, + recommended_fallback: String, + repeated_cursor_count: Integer, + reported_reply_count: Integer, + response_truncated: bool, + richness: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::Richness, + strategies_attempted: ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted], + target_direct_replies: Integer, + unique_direct_replies: Integer, + unrelated_count: Integer + } + + type richness = + { + article: Integer, + author: Integer, + card: Integer, + community_note: Integer, + created_at: Integer, + engagement_counts: Integer, + entities: Integer, + language: Integer, + media: Integer, + quoted_or_reposted_tweet: Integer, + text: Integer, + total_replies: Integer, + url: Integer + } + + class Richness < XTwitterScraper::Internal::Type::BaseModel + attr_accessor article: Integer + + attr_accessor author: Integer + + attr_accessor card: Integer + + attr_accessor community_note: Integer + + attr_accessor created_at: Integer + + attr_accessor engagement_counts: Integer + + attr_accessor entities: Integer + + attr_accessor language: Integer + + attr_accessor media: Integer + + attr_accessor quoted_or_reposted_tweet: Integer + + attr_accessor text: Integer + + attr_accessor total_replies: Integer + + attr_accessor url: Integer + + def initialize: ( + article: Integer, + author: Integer, + card: Integer, + community_note: Integer, + created_at: Integer, + engagement_counts: Integer, + entities: Integer, + language: Integer, + media: Integer, + quoted_or_reposted_tweet: Integer, + text: Integer, + total_replies: Integer, + url: Integer + ) -> void + + def to_hash: -> { + article: Integer, + author: Integer, + card: Integer, + community_note: Integer, + created_at: Integer, + engagement_counts: Integer, + entities: Integer, + language: Integer, + media: Integer, + quoted_or_reposted_tweet: Integer, + text: Integer, + total_replies: Integer, + url: Integer + } + end + + type strategies_attempted = + { + name: String, + new_direct_replies: Integer, + new_nested_replies: Integer, + pages_attempted: Integer, + stop_reason: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::stop_reason + } + + class StrategiesAttempted < XTwitterScraper::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor new_direct_replies: Integer + + attr_accessor new_nested_replies: Integer + + attr_accessor pages_attempted: Integer + + attr_accessor stop_reason: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::stop_reason + + def initialize: ( + name: String, + new_direct_replies: Integer, + new_nested_replies: Integer, + pages_attempted: Integer, + stop_reason: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::stop_reason + ) -> void + + def to_hash: -> { + name: String, + new_direct_replies: Integer, + new_nested_replies: Integer, + pages_attempted: Integer, + stop_reason: XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::stop_reason + } + + type stop_reason = + :deadline + | :empty_pages + | :error + | :missing_cursor + | :no_next_page + | :page_cap + | :repeated_cursor + + module StopReason + extend XTwitterScraper::Internal::Type::Enum + + DEADLINE: :deadline + EMPTY_PAGES: :empty_pages + ERROR: :error + MISSING_CURSOR: :missing_cursor + NO_NEXT_PAGE: :no_next_page + PAGE_CAP: :page_cap + REPEATED_CURSOR: :repeated_cursor + + def self?.values: -> ::Array[XTwitterScraper::Models::X::TweetGetRepliesResponse::Diagnostic::StrategiesAttempted::stop_reason] + end + end + end + end + end + end +end diff --git a/sig/x_twitter_scraper/models/x_get_article_response.rbs b/sig/x_twitter_scraper/models/x_get_article_response.rbs index e781851..7a48f5f 100644 --- a/sig/x_twitter_scraper/models/x_get_article_response.rbs +++ b/sig/x_twitter_scraper/models/x_get_article_response.rbs @@ -206,7 +206,6 @@ module XTwitterScraper id: String, name: String, username: String, - can_dm: bool, created_at: String, description: String, favourites_count: Integer, @@ -231,10 +230,6 @@ module XTwitterScraper attr_accessor username: String - attr_reader can_dm: bool? - - def can_dm=: (bool) -> bool - attr_reader created_at: String? def created_at=: (String) -> String @@ -299,7 +294,6 @@ module XTwitterScraper id: String, name: String, username: String, - ?can_dm: bool, ?created_at: String, ?description: String, ?favourites_count: Integer, @@ -321,7 +315,6 @@ module XTwitterScraper id: String, name: String, username: String, - can_dm: bool, created_at: String, description: String, favourites_count: Integer, diff --git a/sig/x_twitter_scraper/models/x_get_trends_response.rbs b/sig/x_twitter_scraper/models/x_get_trends_response.rbs index 648d75e..593ff0c 100644 --- a/sig/x_twitter_scraper/models/x_get_trends_response.rbs +++ b/sig/x_twitter_scraper/models/x_get_trends_response.rbs @@ -31,7 +31,15 @@ module XTwitterScraper } type trend = - { name: String, description: String, query: String, rank: Integer } + { + name: String, + description: String, + promoted_content: String?, + query: String, + rank: Integer, + tweet_volume: Integer?, + url: String + } class Trend < XTwitterScraper::Internal::Type::BaseModel attr_accessor name: String @@ -40,6 +48,8 @@ module XTwitterScraper def description=: (String) -> String + attr_accessor promoted_content: String? + attr_reader query: String? def query=: (String) -> String @@ -48,18 +58,30 @@ module XTwitterScraper def rank=: (Integer) -> Integer + attr_accessor tweet_volume: Integer? + + attr_reader url: String? + + def url=: (String) -> String + def initialize: ( name: String, ?description: String, + ?promoted_content: String?, ?query: String, - ?rank: Integer + ?rank: Integer, + ?tweet_volume: Integer?, + ?url: String ) -> void def to_hash: -> { name: String, description: String, + promoted_content: String?, query: String, - rank: Integer + rank: Integer, + tweet_volume: Integer?, + url: String } end end diff --git a/sig/x_twitter_scraper/resources/x/accounts.rbs b/sig/x_twitter_scraper/resources/x/accounts.rbs index 96ce1d9..e65f8e9 100644 --- a/sig/x_twitter_scraper/resources/x/accounts.rbs +++ b/sig/x_twitter_scraper/resources/x/accounts.rbs @@ -12,7 +12,7 @@ module XTwitterScraper totp_secret: String, username: String, ?request_options: XTwitterScraper::request_opts - ) -> top + ) -> XTwitterScraper::Models::X::account_create_response def retrieve: ( String id, diff --git a/sig/x_twitter_scraper/resources/x/tweets.rbs b/sig/x_twitter_scraper/resources/x/tweets.rbs index 295711c..b3385d1 100644 --- a/sig/x_twitter_scraper/resources/x/tweets.rbs +++ b/sig/x_twitter_scraper/resources/x/tweets.rbs @@ -92,12 +92,14 @@ module XTwitterScraper ?hashtags: String, ?in_reply_to_tweet_id: String, ?language: String, + ?limit: Integer, ?media_type: XTwitterScraper::Models::X::TweetGetRepliesParams::media_type, ?mentioning: String, ?min_faves: Integer, ?min_quotes: Integer, ?min_replies: Integer, ?min_retweets: Integer, + ?mode: XTwitterScraper::Models::X::TweetGetRepliesParams::mode, ?page_size: Integer, ?quotes: XTwitterScraper::Models::X::TweetGetRepliesParams::quotes, ?quotes_of_tweet_id: String, @@ -112,7 +114,7 @@ module XTwitterScraper ?url: String, ?verified_only: bool, ?request_options: XTwitterScraper::request_opts - ) -> XTwitterScraper::PaginatedTweets + ) -> XTwitterScraper::Models::X::TweetGetRepliesResponse def get_retweeters: ( String id, diff --git a/test/x_twitter_scraper/resources/support/tickets_test.rb b/test/x_twitter_scraper/resources/support/tickets_test.rb index b046836..d58b604 100644 --- a/test/x_twitter_scraper/resources/support/tickets_test.rb +++ b/test/x_twitter_scraper/resources/support/tickets_test.rb @@ -35,12 +35,12 @@ def test_retrieve assert_pattern do response => { - created_at: Time | nil, - messages: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message]) | nil, - public_id: String | nil, - status: String | nil, - subject: String | nil, - updated_at: Time | nil + created_at: Time, + messages: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketRetrieveResponse::Message]), + public_id: String, + status: XTwitterScraper::Models::Support::TicketRetrieveResponse::Status, + subject: String, + updated_at: Time } end end @@ -54,8 +54,8 @@ def test_update_required_params assert_pattern do response => { - public_id: String | nil, - status: String | nil + public_id: String, + status: XTwitterScraper::Models::Support::TicketUpdateResponse::Status } end end @@ -69,7 +69,7 @@ def test_list assert_pattern do response => { - tickets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketListResponse::Ticket]) | nil + tickets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::Models::Support::TicketListResponse::Ticket]) } end end diff --git a/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb b/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb index cc0310d..e582c9a 100644 --- a/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb +++ b/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb @@ -15,10 +15,26 @@ def test_retrieve assert_pattern do case response - in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptPending - in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptSuccess - in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionAttemptFailed - in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::XAccountConnectionChallenge + in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending + in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success + in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed + in XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode + end + end + + assert_pattern do + case response + in {status: :pending, id: String, object: Symbol, poll_after_ms: Integer} + in {status: :success, id: String, object: Symbol} + in { + status: :failed, + id: String, + error: String, + object: Symbol, + retryable: XTwitterScraper::Internal::Type::Boolean, + reason: String | nil + } + in {status: :requires_email_code, id: String, expires_at: Time, message: String, object: Symbol, username: String} end end end diff --git a/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb b/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb index a2d7348..9cabbd6 100644 --- a/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb +++ b/test/x_twitter_scraper/resources/x/account_connection_challenges_test.rb @@ -20,7 +20,7 @@ def test_submit_required_params id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountConnectionChallengeSubmitResponse::Health, - status: String, + status: Symbol, x_user_id: String, x_username: String } diff --git a/test/x_twitter_scraper/resources/x/accounts_test.rb b/test/x_twitter_scraper/resources/x/accounts_test.rb index 35d7cd1..6e709f3 100644 --- a/test/x_twitter_scraper/resources/x/accounts_test.rb +++ b/test/x_twitter_scraper/resources/x/accounts_test.rb @@ -17,7 +17,15 @@ def test_create_required_params ) assert_pattern do - response => XTwitterScraper::Internal::Type::Unknown + response => XTwitterScraper::Models::X::AccountCreateResponse + end + + assert_pattern do + case response + in XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount + in XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending + in XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge + end end end @@ -96,7 +104,7 @@ def test_reauth_required_params id: String, created_at: Time, health: XTwitterScraper::Models::X::AccountReauthResponse::Health, - status: String, + status: Symbol, x_user_id: String, x_username: String } diff --git a/test/x_twitter_scraper/resources/x/tweets_test.rb b/test/x_twitter_scraper/resources/x/tweets_test.rb index d81b3b0..20522b2 100644 --- a/test/x_twitter_scraper/resources/x/tweets_test.rb +++ b/test/x_twitter_scraper/resources/x/tweets_test.rb @@ -187,15 +187,7 @@ def test_get_replies response = @x_twitter_scraper.x.tweets.get_replies("id") assert_pattern do - response => XTwitterScraper::PaginatedTweets - end - - assert_pattern do - response => { - has_next_page: XTwitterScraper::Internal::Type::Boolean, - next_cursor: String, - tweets: ^(XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet]) - } + response => XTwitterScraper::Models::X::TweetGetRepliesResponse end end diff --git a/test/x_twitter_scraper/resources/x/users_test.rb b/test/x_twitter_scraper/resources/x/users_test.rb index de515da..b0dff26 100644 --- a/test/x_twitter_scraper/resources/x/users_test.rb +++ b/test/x_twitter_scraper/resources/x/users_test.rb @@ -19,36 +19,48 @@ def test_retrieve id: String, name: String, username: String, + affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel | nil, automated_by: String | nil, - can_dm: XTwitterScraper::Internal::Type::Boolean | nil, + business_account_affiliates_count: Integer | nil, community_role: String | nil, cover_picture: String | nil, created_at: String | nil, + creator_subscriptions_count: Integer | nil, description: String | nil, favourites_count: Integer | nil, followers: Integer | nil, following: Integer | nil, has_custom_timelines: XTwitterScraper::Internal::Type::Boolean | nil, + has_graduated_access: XTwitterScraper::Internal::Type::Boolean | nil, + has_hidden_subscriptions_on_profile: XTwitterScraper::Internal::Type::Boolean | nil, + highlights_info: XTwitterScraper::UserProfile::HighlightsInfo | nil, + identity_verification: XTwitterScraper::UserProfile::IdentityVerification | nil, is_automated: XTwitterScraper::Internal::Type::Boolean | nil, is_blue_verified: XTwitterScraper::Internal::Type::Boolean | nil, + is_profile_translatable: XTwitterScraper::Internal::Type::Boolean | nil, is_translator: XTwitterScraper::Internal::Type::Boolean | nil, is_verified: XTwitterScraper::Internal::Type::Boolean | nil, location: String | nil, media_count: Integer | nil, + parody_commentary_fan_label: String | nil, pinned_tweet_ids: ^(XTwitterScraper::Internal::Type::ArrayOf[String]) | nil, possibly_sensitive: XTwitterScraper::Internal::Type::Boolean | nil, profile_bio: ^(XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]) | nil, profile_banner_url: String | nil, + profile_description_language: String | nil, + profile_image_shape: String | nil, + profile_interstitial_type: String | nil, profile_picture: String | nil, + profile_sort_enabled: XTwitterScraper::Internal::Type::Boolean | nil, + profile_translator_type: String | nil, protected: XTwitterScraper::Internal::Type::Boolean | nil, statuses_count: Integer | nil, + super_follow_eligible: XTwitterScraper::Internal::Type::Boolean | nil, unavailable: XTwitterScraper::Internal::Type::Boolean | nil, unavailable_reason: String | nil, url: String | nil, verified: XTwitterScraper::Internal::Type::Boolean | nil, verified_type: String | nil, - viewer_followed_by: XTwitterScraper::Internal::Type::Boolean | nil, - viewer_following: XTwitterScraper::Internal::Type::Boolean | nil, withheld_in_countries: ^(XTwitterScraper::Internal::Type::ArrayOf[String]) | nil } end From 443ea3b57c95923f5b6b10eb85131f9cfd3d7712 Mon Sep 17 00:00:00 2001 From: kriptoburak Date: Fri, 31 Jul 2026 17:38:13 +0300 Subject: [PATCH 2/2] fix(types): align rich read model signatures Signed-off-by: kriptoburak --- lib/x_twitter_scraper/internal/type/union.rb | 4 + ...nt_connection_attempt_retrieve_response.rb | 53 ++++ .../resources/x/communities.rb | 2 +- ...t_connection_attempt_retrieve_response.rbi | 41 +++ .../models/embedded_tweet.rbs | 248 +++--------------- sig/x_twitter_scraper/models/search_tweet.rbs | 248 +++--------------- .../models/trend_list_response.rbs | 34 +-- sig/x_twitter_scraper/models/tweet_media.rbs | 61 +---- sig/x_twitter_scraper/models/user_profile.rbs | 150 +---------- ...t_connection_attempt_retrieve_response.rbs | 37 +++ .../models/x/tweet_author.rbs | 6 +- .../models/x/tweet_detail.rbs | 248 +++--------------- .../x/account_connection_attempts_test.rb | 14 + 13 files changed, 297 insertions(+), 849 deletions(-) diff --git a/lib/x_twitter_scraper/internal/type/union.rb b/lib/x_twitter_scraper/internal/type/union.rb index 4cc3730..1881d67 100644 --- a/lib/x_twitter_scraper/internal/type/union.rb +++ b/lib/x_twitter_scraper/internal/type/union.rb @@ -18,6 +18,8 @@ module Type # puts(account_connection_attempt_retrieve_response.object) # when XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed # puts(account_connection_attempt_retrieve_response.error) + # when XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode + # puts(account_connection_attempt_retrieve_response.message) # else # puts(account_connection_attempt_retrieve_response) # end @@ -30,6 +32,8 @@ module Type # puts(object) # in {status: :failed, id: id, error: error, object: object} # puts(error) + # in {status: :requires_email_code, id: id, message: message} + # puts(message) # else # puts(account_connection_attempt_retrieve_response) # end diff --git a/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb b/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb index f6e5ee7..e30adb5 100644 --- a/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +++ b/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb @@ -52,6 +52,18 @@ class Pending < XTwitterScraper::Internal::Type::BaseModel # @param poll_after_ms [Integer] # @param object [Symbol, :x_account_connection_attempt] # @param status [Symbol, :pending] + + module Object + extend XTwitterScraper::Internal::Type::Enum + + X_ACCOUNT_CONNECTION_ATTEMPT = :x_account_connection_attempt + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + PENDING = :pending + end end class Success < XTwitterScraper::Internal::Type::BaseModel @@ -76,6 +88,18 @@ class Success < XTwitterScraper::Internal::Type::BaseModel # @param id [String] # @param object [Symbol, :x_account_connection_attempt] # @param status [Symbol, :success] + + module Object + extend XTwitterScraper::Internal::Type::Enum + + X_ACCOUNT_CONNECTION_ATTEMPT = :x_account_connection_attempt + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + SUCCESS = :success + end end class Failed < XTwitterScraper::Internal::Type::BaseModel @@ -118,6 +142,18 @@ class Failed < XTwitterScraper::Internal::Type::BaseModel # @param reason [String] # @param object [Symbol, :x_account_connection_attempt] # @param status [Symbol, :failed] + + module Object + extend XTwitterScraper::Internal::Type::Enum + + X_ACCOUNT_CONNECTION_ATTEMPT = :x_account_connection_attempt + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + FAILED = :failed + end end class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel @@ -161,8 +197,25 @@ class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel # @param username [String] # @param object [Symbol, :x_account_connection_challenge] # @param status [Symbol, :requires_email_code] + + module Object + extend XTwitterScraper::Internal::Type::Enum + + X_ACCOUNT_CONNECTION_CHALLENGE = :x_account_connection_challenge + end + + module Status + extend XTwitterScraper::Internal::Type::Enum + + REQUIRES_EMAIL_CODE = :requires_email_code + end end + XAccountConnectionAttemptPending = Pending + XAccountConnectionAttemptSuccess = Success + XAccountConnectionAttemptFailed = Failed + XAccountConnectionChallenge = RequiresEmailCode + # @!method self.variants # @return [Array(XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Pending, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Success, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::Failed, XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse::RequiresEmailCode)] end diff --git a/lib/x_twitter_scraper/resources/x/communities.rb b/lib/x_twitter_scraper/resources/x/communities.rb index 390dfcb..ed4e61d 100644 --- a/lib/x_twitter_scraper/resources/x/communities.rb +++ b/lib/x_twitter_scraper/resources/x/communities.rb @@ -170,7 +170,7 @@ def retrieve_moderators(id, params = {}) # # @param cursor [String] Pagination cursor for community search # - # @param page_size [Integer] Maximum page items (1-100, default 20). Source, filters, or credits can reduce r + # @param page_size [Integer] Maximum page items (1-100, default 20). The source, filters, or credits can reduce results. # # @param query_type [Symbol, XTwitterScraper::Models::X::CommunityRetrieveSearchParams::QueryType] Sort order (Latest or Top) # diff --git a/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi b/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi index 31becfe..9bb5e60 100644 --- a/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +++ b/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi @@ -67,6 +67,15 @@ module XTwitterScraper end def to_hash end + + module Object + X_ACCOUNT_CONNECTION_ATTEMPT = + T.let(:x_account_connection_attempt, Symbol) + end + + module Status + PENDING = T.let(:pending, Symbol) + end end class Success < XTwitterScraper::Internal::Type::BaseModel @@ -105,6 +114,15 @@ module XTwitterScraper end def to_hash end + + module Object + X_ACCOUNT_CONNECTION_ATTEMPT = + T.let(:x_account_connection_attempt, Symbol) + end + + module Status + SUCCESS = T.let(:success, Symbol) + end end class Failed < XTwitterScraper::Internal::Type::BaseModel @@ -172,6 +190,15 @@ module XTwitterScraper end def to_hash end + + module Object + X_ACCOUNT_CONNECTION_ATTEMPT = + T.let(:x_account_connection_attempt, Symbol) + end + + module Status + FAILED = T.let(:failed, Symbol) + end end class RequiresEmailCode < XTwitterScraper::Internal::Type::BaseModel @@ -237,8 +264,22 @@ module XTwitterScraper end def to_hash end + + module Object + X_ACCOUNT_CONNECTION_CHALLENGE = + T.let(:x_account_connection_challenge, Symbol) + end + + module Status + REQUIRES_EMAIL_CODE = T.let(:requires_email_code, Symbol) + end end + XAccountConnectionAttemptPending = Pending + XAccountConnectionAttemptSuccess = Success + XAccountConnectionAttemptFailed = Failed + XAccountConnectionChallenge = RequiresEmailCode + sig do override.returns( T::Array[ diff --git a/sig/x_twitter_scraper/models/embedded_tweet.rbs b/sig/x_twitter_scraper/models/embedded_tweet.rbs index d9ad9f0..9dfb33d 100644 --- a/sig/x_twitter_scraper/models/embedded_tweet.rbs +++ b/sig/x_twitter_scraper/models/embedded_tweet.rbs @@ -4,47 +4,7 @@ module XTwitterScraper module Models - type embedded_tweet = - { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - article: XTwitterScraper::EmbeddedTweet::Article, - author: XTwitterScraper::UserProfile, - card: XTwitterScraper::EmbeddedTweet::Card, - community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, - content_disclosure: XTwitterScraper::ContentDisclosure, - conversation_id: String, - created_at: String, - display_text_range: ::Array[Integer], - edit: XTwitterScraper::EmbeddedTweet::Edit, - entities: ::Hash[Symbol, top], - in_reply_to_id: String, - in_reply_to_user_id: String, - in_reply_to_username: String, - is_limited_reply: bool, - is_note_tweet: bool, - is_quote_status: bool, - is_reply: bool, - is_translatable: bool, - lang: String, - media: ::Array[XTwitterScraper::TweetMedia], - note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, - place: XTwitterScraper::EmbeddedTweet::Place, - possibly_sensitive: bool, - previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, - quoted_tweet: XTwitterScraper::EmbeddedTweet, - retweeted_tweet: XTwitterScraper::EmbeddedTweet, - source: String, - type: String, - url: String, - view_state: String - } + type embedded_tweet = ::Hash[Symbol, top] class EmbeddedTweet < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String @@ -66,31 +26,31 @@ module XTwitterScraper attr_reader article: XTwitterScraper::EmbeddedTweet::Article? def article=: ( - XTwitterScraper::EmbeddedTweet::Article + XTwitterScraper::EmbeddedTweet::Article | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::Article attr_reader author: XTwitterScraper::UserProfile? def author=: ( - XTwitterScraper::UserProfile + XTwitterScraper::UserProfile | ::Hash[Symbol, top] ) -> XTwitterScraper::UserProfile attr_reader card: XTwitterScraper::EmbeddedTweet::Card? def card=: ( - XTwitterScraper::EmbeddedTweet::Card + XTwitterScraper::EmbeddedTweet::Card | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::Card attr_reader community_note: XTwitterScraper::EmbeddedTweet::CommunityNote? def community_note=: ( - XTwitterScraper::EmbeddedTweet::CommunityNote + XTwitterScraper::EmbeddedTweet::CommunityNote | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::CommunityNote attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? def content_disclosure=: ( - XTwitterScraper::ContentDisclosure + XTwitterScraper::ContentDisclosure | ::Hash[Symbol, top] ) -> XTwitterScraper::ContentDisclosure attr_reader conversation_id: String? @@ -108,7 +68,7 @@ module XTwitterScraper attr_reader edit: XTwitterScraper::EmbeddedTweet::Edit? def edit=: ( - XTwitterScraper::EmbeddedTweet::Edit + XTwitterScraper::EmbeddedTweet::Edit | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::Edit attr_reader entities: ::Hash[Symbol, top]? @@ -160,13 +120,13 @@ module XTwitterScraper attr_reader note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet? def note_tweet=: ( - XTwitterScraper::EmbeddedTweet::NoteTweet + XTwitterScraper::EmbeddedTweet::NoteTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::NoteTweet attr_reader place: XTwitterScraper::EmbeddedTweet::Place? def place=: ( - XTwitterScraper::EmbeddedTweet::Place + XTwitterScraper::EmbeddedTweet::Place | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::Place attr_reader possibly_sensitive: bool? @@ -176,19 +136,19 @@ module XTwitterScraper attr_reader previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts? def previous_counts=: ( - XTwitterScraper::EmbeddedTweet::PreviousCounts + XTwitterScraper::EmbeddedTweet::PreviousCounts | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet::PreviousCounts attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? def quoted_tweet=: ( - XTwitterScraper::EmbeddedTweet + XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet attr_reader retweeted_tweet: XTwitterScraper::EmbeddedTweet? def retweeted_tweet=: ( - XTwitterScraper::EmbeddedTweet + XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet attr_reader source: String? @@ -216,15 +176,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - ?article: XTwitterScraper::EmbeddedTweet::Article, - ?author: XTwitterScraper::UserProfile, - ?card: XTwitterScraper::EmbeddedTweet::Card, - ?community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, - ?content_disclosure: XTwitterScraper::ContentDisclosure, + ?article: XTwitterScraper::EmbeddedTweet::Article | ::Hash[Symbol, top], + ?author: XTwitterScraper::UserProfile | ::Hash[Symbol, top], + ?card: XTwitterScraper::EmbeddedTweet::Card | ::Hash[Symbol, top], + ?community_note: XTwitterScraper::EmbeddedTweet::CommunityNote | ::Hash[Symbol, top], + ?content_disclosure: XTwitterScraper::ContentDisclosure | ::Hash[Symbol, top], ?conversation_id: String, ?created_at: String, ?display_text_range: ::Array[Integer], - ?edit: XTwitterScraper::EmbeddedTweet::Edit, + ?edit: XTwitterScraper::EmbeddedTweet::Edit | ::Hash[Symbol, top], ?entities: ::Hash[Symbol, top], ?in_reply_to_id: String, ?in_reply_to_user_id: String, @@ -236,66 +196,21 @@ module XTwitterScraper ?is_translatable: bool, ?lang: String, ?media: ::Array[XTwitterScraper::TweetMedia], - ?note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, - ?place: XTwitterScraper::EmbeddedTweet::Place, + ?note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet | ::Hash[Symbol, top], + ?place: XTwitterScraper::EmbeddedTweet::Place | ::Hash[Symbol, top], ?possibly_sensitive: bool, - ?previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, - ?quoted_tweet: XTwitterScraper::EmbeddedTweet, - ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, + ?previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts | ::Hash[Symbol, top], + ?quoted_tweet: XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top], + ?retweeted_tweet: XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top], ?source: String, ?type: String, ?url: String, ?view_state: String ) -> void - def to_hash: -> { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - article: XTwitterScraper::EmbeddedTweet::Article, - author: XTwitterScraper::UserProfile, - card: XTwitterScraper::EmbeddedTweet::Card, - community_note: XTwitterScraper::EmbeddedTweet::CommunityNote, - content_disclosure: XTwitterScraper::ContentDisclosure, - conversation_id: String, - created_at: String, - display_text_range: ::Array[Integer], - edit: XTwitterScraper::EmbeddedTweet::Edit, - entities: ::Hash[Symbol, top], - in_reply_to_id: String, - in_reply_to_user_id: String, - in_reply_to_username: String, - is_limited_reply: bool, - is_note_tweet: bool, - is_quote_status: bool, - is_reply: bool, - is_translatable: bool, - lang: String, - media: ::Array[XTwitterScraper::TweetMedia], - note_tweet: XTwitterScraper::EmbeddedTweet::NoteTweet, - place: XTwitterScraper::EmbeddedTweet::Place, - possibly_sensitive: bool, - previous_counts: XTwitterScraper::EmbeddedTweet::PreviousCounts, - quoted_tweet: XTwitterScraper::EmbeddedTweet, - retweeted_tweet: XTwitterScraper::EmbeddedTweet, - source: String, - type: String, - url: String, - view_state: String - } - - type article = - { - id: String, - cover_media_url: String, - preview_text: String, - title: String - } + def to_hash: -> ::Hash[Symbol, top] + + type article = ::Hash[Symbol, top] class Article < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -321,21 +236,10 @@ module XTwitterScraper ?title: String ) -> void - def to_hash: -> { - id: String, - cover_media_url: String, - preview_text: String, - title: String - } + def to_hash: -> ::Hash[Symbol, top] end - type card = - { - id: String, - binding_values: ::Hash[Symbol, top], - name: String, - url: String - } + type card = ::Hash[Symbol, top] class Card < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -361,24 +265,10 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - id: String, - binding_values: ::Hash[Symbol, top], - name: String, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end - type community_note = - { - id: String, - destination_url: String, - footer: String, - short_title: String, - subtitle: String, - title: String, - visual_style: String - } + type community_note = ::Hash[Symbol, top] class CommunityNote < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -419,15 +309,7 @@ module XTwitterScraper ?visual_style: String ) -> void - def to_hash: -> { - id: String, - destination_url: String, - footer: String, - short_title: String, - subtitle: String, - title: String, - visual_style: String - } + def to_hash: -> ::Hash[Symbol, top] end type edit = @@ -447,20 +329,10 @@ module XTwitterScraper ?edit_tweet_ids: ::Array[String] ) -> void - def to_hash: -> { - editable_until_msecs: String, - edit_tweet_ids: ::Array[String] - } + def to_hash: -> ::Hash[Symbol, top] end - type note_tweet = - { - text: String, - id: String, - entities: ::Hash[Symbol, top], - is_expandable: bool, - richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] - } + type note_tweet = ::Hash[Symbol, top] class NoteTweet < XTwitterScraper::Internal::Type::BaseModel attr_accessor text: String @@ -491,13 +363,7 @@ module XTwitterScraper ?richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] ) -> void - def to_hash: -> { - text: String, - id: String, - entities: ::Hash[Symbol, top], - is_expandable: bool, - richtext_tags: ::Array[XTwitterScraper::EmbeddedTweet::NoteTweet::RichtextTag] - } + def to_hash: -> ::Hash[Symbol, top] type richtext_tag = { from_index: Integer, to_index: Integer, types: ::Array[String] } @@ -515,25 +381,11 @@ module XTwitterScraper types: ::Array[String] ) -> void - def to_hash: -> { - from_index: Integer, - to_index: Integer, - types: ::Array[String] - } + def to_hash: -> ::Hash[Symbol, top] end end - type place = - { - id: String, - bounding_box: ::Hash[Symbol, top], - country: String, - country_code: String, - full_name: String, - name: String, - place_type: String, - url: String - } + type place = ::Hash[Symbol, top] class Place < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -579,26 +431,10 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - id: String, - bounding_box: ::Hash[Symbol, top], - country: String, - country_code: String, - full_name: String, - name: String, - place_type: String, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end - type previous_counts = - { - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer - } + type previous_counts = ::Hash[Symbol, top] class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel attr_reader bookmark_count: Integer? @@ -629,13 +465,7 @@ module XTwitterScraper ?retweet_count: Integer ) -> void - def to_hash: -> { - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer - } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/sig/x_twitter_scraper/models/search_tweet.rbs b/sig/x_twitter_scraper/models/search_tweet.rbs index 0e65f13..783a086 100644 --- a/sig/x_twitter_scraper/models/search_tweet.rbs +++ b/sig/x_twitter_scraper/models/search_tweet.rbs @@ -4,47 +4,7 @@ module XTwitterScraper module Models - type search_tweet = - { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - article: XTwitterScraper::SearchTweet::Article, - author: XTwitterScraper::UserProfile, - card: XTwitterScraper::SearchTweet::Card, - community_note: XTwitterScraper::SearchTweet::CommunityNote, - content_disclosure: XTwitterScraper::ContentDisclosure, - conversation_id: String, - created_at: String, - display_text_range: ::Array[Integer], - edit: XTwitterScraper::SearchTweet::Edit, - entities: ::Hash[Symbol, top], - in_reply_to_id: String, - in_reply_to_user_id: String, - in_reply_to_username: String, - is_limited_reply: bool, - is_note_tweet: bool, - is_quote_status: bool, - is_reply: bool, - is_translatable: bool, - lang: String, - media: ::Array[XTwitterScraper::TweetMedia], - note_tweet: XTwitterScraper::SearchTweet::NoteTweet, - place: XTwitterScraper::SearchTweet::Place, - possibly_sensitive: bool, - previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, - quoted_tweet: XTwitterScraper::EmbeddedTweet, - retweeted_tweet: XTwitterScraper::EmbeddedTweet, - source: String, - type: String, - url: String, - view_state: String - } + type search_tweet = ::Hash[Symbol, top] class SearchTweet < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String @@ -66,31 +26,31 @@ module XTwitterScraper attr_reader article: XTwitterScraper::SearchTweet::Article? def article=: ( - XTwitterScraper::SearchTweet::Article + XTwitterScraper::SearchTweet::Article | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::Article attr_reader author: XTwitterScraper::UserProfile? def author=: ( - XTwitterScraper::UserProfile + XTwitterScraper::UserProfile | ::Hash[Symbol, top] ) -> XTwitterScraper::UserProfile attr_reader card: XTwitterScraper::SearchTweet::Card? def card=: ( - XTwitterScraper::SearchTweet::Card + XTwitterScraper::SearchTweet::Card | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::Card attr_reader community_note: XTwitterScraper::SearchTweet::CommunityNote? def community_note=: ( - XTwitterScraper::SearchTweet::CommunityNote + XTwitterScraper::SearchTweet::CommunityNote | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::CommunityNote attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? def content_disclosure=: ( - XTwitterScraper::ContentDisclosure + XTwitterScraper::ContentDisclosure | ::Hash[Symbol, top] ) -> XTwitterScraper::ContentDisclosure attr_reader conversation_id: String? @@ -108,7 +68,7 @@ module XTwitterScraper attr_reader edit: XTwitterScraper::SearchTweet::Edit? def edit=: ( - XTwitterScraper::SearchTweet::Edit + XTwitterScraper::SearchTweet::Edit | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::Edit attr_reader entities: ::Hash[Symbol, top]? @@ -160,13 +120,13 @@ module XTwitterScraper attr_reader note_tweet: XTwitterScraper::SearchTweet::NoteTweet? def note_tweet=: ( - XTwitterScraper::SearchTweet::NoteTweet + XTwitterScraper::SearchTweet::NoteTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::NoteTweet attr_reader place: XTwitterScraper::SearchTweet::Place? def place=: ( - XTwitterScraper::SearchTweet::Place + XTwitterScraper::SearchTweet::Place | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::Place attr_reader possibly_sensitive: bool? @@ -176,19 +136,19 @@ module XTwitterScraper attr_reader previous_counts: XTwitterScraper::SearchTweet::PreviousCounts? def previous_counts=: ( - XTwitterScraper::SearchTweet::PreviousCounts + XTwitterScraper::SearchTweet::PreviousCounts | ::Hash[Symbol, top] ) -> XTwitterScraper::SearchTweet::PreviousCounts attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? def quoted_tweet=: ( - XTwitterScraper::EmbeddedTweet + XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet attr_reader retweeted_tweet: XTwitterScraper::EmbeddedTweet? def retweeted_tweet=: ( - XTwitterScraper::EmbeddedTweet + XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet attr_reader source: String? @@ -216,15 +176,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - ?article: XTwitterScraper::SearchTweet::Article, - ?author: XTwitterScraper::UserProfile, - ?card: XTwitterScraper::SearchTweet::Card, - ?community_note: XTwitterScraper::SearchTweet::CommunityNote, - ?content_disclosure: XTwitterScraper::ContentDisclosure, + ?article: XTwitterScraper::SearchTweet::Article | ::Hash[Symbol, top], + ?author: XTwitterScraper::UserProfile | ::Hash[Symbol, top], + ?card: XTwitterScraper::SearchTweet::Card | ::Hash[Symbol, top], + ?community_note: XTwitterScraper::SearchTweet::CommunityNote | ::Hash[Symbol, top], + ?content_disclosure: XTwitterScraper::ContentDisclosure | ::Hash[Symbol, top], ?conversation_id: String, ?created_at: String, ?display_text_range: ::Array[Integer], - ?edit: XTwitterScraper::SearchTweet::Edit, + ?edit: XTwitterScraper::SearchTweet::Edit | ::Hash[Symbol, top], ?entities: ::Hash[Symbol, top], ?in_reply_to_id: String, ?in_reply_to_user_id: String, @@ -236,66 +196,21 @@ module XTwitterScraper ?is_translatable: bool, ?lang: String, ?media: ::Array[XTwitterScraper::TweetMedia], - ?note_tweet: XTwitterScraper::SearchTweet::NoteTweet, - ?place: XTwitterScraper::SearchTweet::Place, + ?note_tweet: XTwitterScraper::SearchTweet::NoteTweet | ::Hash[Symbol, top], + ?place: XTwitterScraper::SearchTweet::Place | ::Hash[Symbol, top], ?possibly_sensitive: bool, - ?previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, - ?quoted_tweet: XTwitterScraper::EmbeddedTweet, - ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, + ?previous_counts: XTwitterScraper::SearchTweet::PreviousCounts | ::Hash[Symbol, top], + ?quoted_tweet: XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top], + ?retweeted_tweet: XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top], ?source: String, ?type: String, ?url: String, ?view_state: String ) -> void - def to_hash: -> { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - article: XTwitterScraper::SearchTweet::Article, - author: XTwitterScraper::UserProfile, - card: XTwitterScraper::SearchTweet::Card, - community_note: XTwitterScraper::SearchTweet::CommunityNote, - content_disclosure: XTwitterScraper::ContentDisclosure, - conversation_id: String, - created_at: String, - display_text_range: ::Array[Integer], - edit: XTwitterScraper::SearchTweet::Edit, - entities: ::Hash[Symbol, top], - in_reply_to_id: String, - in_reply_to_user_id: String, - in_reply_to_username: String, - is_limited_reply: bool, - is_note_tweet: bool, - is_quote_status: bool, - is_reply: bool, - is_translatable: bool, - lang: String, - media: ::Array[XTwitterScraper::TweetMedia], - note_tweet: XTwitterScraper::SearchTweet::NoteTweet, - place: XTwitterScraper::SearchTweet::Place, - possibly_sensitive: bool, - previous_counts: XTwitterScraper::SearchTweet::PreviousCounts, - quoted_tweet: XTwitterScraper::EmbeddedTweet, - retweeted_tweet: XTwitterScraper::EmbeddedTweet, - source: String, - type: String, - url: String, - view_state: String - } - - type article = - { - id: String, - cover_media_url: String, - preview_text: String, - title: String - } + def to_hash: -> ::Hash[Symbol, top] + + type article = ::Hash[Symbol, top] class Article < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -321,21 +236,10 @@ module XTwitterScraper ?title: String ) -> void - def to_hash: -> { - id: String, - cover_media_url: String, - preview_text: String, - title: String - } + def to_hash: -> ::Hash[Symbol, top] end - type card = - { - id: String, - binding_values: ::Hash[Symbol, top], - name: String, - url: String - } + type card = ::Hash[Symbol, top] class Card < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -361,24 +265,10 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - id: String, - binding_values: ::Hash[Symbol, top], - name: String, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end - type community_note = - { - id: String, - destination_url: String, - footer: String, - short_title: String, - subtitle: String, - title: String, - visual_style: String - } + type community_note = ::Hash[Symbol, top] class CommunityNote < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -419,15 +309,7 @@ module XTwitterScraper ?visual_style: String ) -> void - def to_hash: -> { - id: String, - destination_url: String, - footer: String, - short_title: String, - subtitle: String, - title: String, - visual_style: String - } + def to_hash: -> ::Hash[Symbol, top] end type edit = @@ -447,20 +329,10 @@ module XTwitterScraper ?edit_tweet_ids: ::Array[String] ) -> void - def to_hash: -> { - editable_until_msecs: String, - edit_tweet_ids: ::Array[String] - } + def to_hash: -> ::Hash[Symbol, top] end - type note_tweet = - { - text: String, - id: String, - entities: ::Hash[Symbol, top], - is_expandable: bool, - richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] - } + type note_tweet = ::Hash[Symbol, top] class NoteTweet < XTwitterScraper::Internal::Type::BaseModel attr_accessor text: String @@ -491,13 +363,7 @@ module XTwitterScraper ?richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] ) -> void - def to_hash: -> { - text: String, - id: String, - entities: ::Hash[Symbol, top], - is_expandable: bool, - richtext_tags: ::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag] - } + def to_hash: -> ::Hash[Symbol, top] type richtext_tag = { from_index: Integer, to_index: Integer, types: ::Array[String] } @@ -515,25 +381,11 @@ module XTwitterScraper types: ::Array[String] ) -> void - def to_hash: -> { - from_index: Integer, - to_index: Integer, - types: ::Array[String] - } + def to_hash: -> ::Hash[Symbol, top] end end - type place = - { - id: String, - bounding_box: ::Hash[Symbol, top], - country: String, - country_code: String, - full_name: String, - name: String, - place_type: String, - url: String - } + type place = ::Hash[Symbol, top] class Place < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -579,26 +431,10 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - id: String, - bounding_box: ::Hash[Symbol, top], - country: String, - country_code: String, - full_name: String, - name: String, - place_type: String, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end - type previous_counts = - { - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer - } + type previous_counts = ::Hash[Symbol, top] class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel attr_reader bookmark_count: Integer? @@ -629,13 +465,7 @@ module XTwitterScraper ?retweet_count: Integer ) -> void - def to_hash: -> { - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer - } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/sig/x_twitter_scraper/models/trend_list_response.rbs b/sig/x_twitter_scraper/models/trend_list_response.rbs index 95194a1..701ca42 100644 --- a/sig/x_twitter_scraper/models/trend_list_response.rbs +++ b/sig/x_twitter_scraper/models/trend_list_response.rbs @@ -4,12 +4,7 @@ module XTwitterScraper module Models - type trend_list_response = - { - total: Integer, - trends: ::Array[XTwitterScraper::Models::TrendListResponse::Trend], - woeid: Integer - } + type trend_list_response = ::Hash[Symbol, top] class TrendListResponse < XTwitterScraper::Internal::Type::BaseModel attr_accessor total: Integer @@ -24,22 +19,9 @@ module XTwitterScraper woeid: Integer ) -> void - def to_hash: -> { - total: Integer, - trends: ::Array[XTwitterScraper::Models::TrendListResponse::Trend], - woeid: Integer - } + def to_hash: -> ::Hash[Symbol, top] - type trend = - { - name: String, - description: String, - promoted_content: String?, - query: String, - rank: Integer, - tweet_volume: Integer?, - url: String - } + type trend = ::Hash[Symbol, top] class Trend < XTwitterScraper::Internal::Type::BaseModel attr_accessor name: String @@ -74,15 +56,7 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - name: String, - description: String, - promoted_content: String?, - query: String, - rank: Integer, - tweet_volume: Integer?, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/sig/x_twitter_scraper/models/tweet_media.rbs b/sig/x_twitter_scraper/models/tweet_media.rbs index 27ea6ce..6a8996a 100644 --- a/sig/x_twitter_scraper/models/tweet_media.rbs +++ b/sig/x_twitter_scraper/models/tweet_media.rbs @@ -4,29 +4,7 @@ module XTwitterScraper module Models - type tweet_media = - { - media_url: String, - type: XTwitterScraper::Models::TweetMedia::type_, - url: String, - id: String, - allow_download: bool, - alt_text: String, - aspect_ratio: ::Array[Integer], - availability_status: String, - display_url: String, - duration_millis: Integer, - expanded_url: String, - face_rects: ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]], - focus_rects: ::Array[XTwitterScraper::TweetMedia::FocusRect], - height: Integer, - indices: ::Array[Integer], - media_key: String, - monetizable: bool, - sizes: ::Hash[Symbol, XTwitterScraper::TweetMedia::Size], - video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant], - width: Integer - } + type tweet_media = ::Hash[Symbol, top] class TweetMedia < XTwitterScraper::Internal::Type::BaseModel attr_accessor media_url: String @@ -134,28 +112,7 @@ module XTwitterScraper ?width: Integer ) -> void - def to_hash: -> { - media_url: String, - type: XTwitterScraper::Models::TweetMedia::type_, - url: String, - id: String, - allow_download: bool, - alt_text: String, - aspect_ratio: ::Array[Integer], - availability_status: String, - display_url: String, - duration_millis: Integer, - expanded_url: String, - face_rects: ::Hash[Symbol, ::Array[XTwitterScraper::TweetMedia::FaceRect]], - focus_rects: ::Array[XTwitterScraper::TweetMedia::FocusRect], - height: Integer, - indices: ::Array[Integer], - media_key: String, - monetizable: bool, - sizes: ::Hash[Symbol, XTwitterScraper::TweetMedia::Size], - video_variants: ::Array[XTwitterScraper::TweetMedia::VideoVariant], - width: Integer - } + def to_hash: -> ::Hash[Symbol, top] type type_ = :photo | :video | :animated_gif @@ -169,7 +126,7 @@ module XTwitterScraper def self?.values: -> ::Array[XTwitterScraper::Models::TweetMedia::type_] end - type face_rect = { h: Integer, w: Integer, x: Integer, y_: Integer } + type face_rect = ::Hash[Symbol, top] class FaceRect < XTwitterScraper::Internal::Type::BaseModel attr_accessor h: Integer @@ -187,10 +144,10 @@ module XTwitterScraper y_: Integer ) -> void - def to_hash: -> { h: Integer, w: Integer, x: Integer, y_: Integer } + def to_hash: -> ::Hash[Symbol, top] end - type focus_rect = { h: Integer, w: Integer, x: Integer, y_: Integer } + type focus_rect = ::Hash[Symbol, top] class FocusRect < XTwitterScraper::Internal::Type::BaseModel attr_accessor h: Integer @@ -208,10 +165,10 @@ module XTwitterScraper y_: Integer ) -> void - def to_hash: -> { h: Integer, w: Integer, x: Integer, y_: Integer } + def to_hash: -> ::Hash[Symbol, top] end - type size = { h: Integer, resize: String, w: Integer } + type size = ::Hash[Symbol, top] class Size < XTwitterScraper::Internal::Type::BaseModel attr_accessor h: Integer @@ -222,7 +179,7 @@ module XTwitterScraper def initialize: (h: Integer, resize: String, w: Integer) -> void - def to_hash: -> { h: Integer, resize: String, w: Integer } + def to_hash: -> ::Hash[Symbol, top] end type video_variant = @@ -243,7 +200,7 @@ module XTwitterScraper ?bitrate: Integer ) -> void - def to_hash: -> { content_type: String, url: String, bitrate: Integer } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/sig/x_twitter_scraper/models/user_profile.rbs b/sig/x_twitter_scraper/models/user_profile.rbs index 0371099..6331d77 100644 --- a/sig/x_twitter_scraper/models/user_profile.rbs +++ b/sig/x_twitter_scraper/models/user_profile.rbs @@ -4,55 +4,7 @@ module XTwitterScraper module Models - type user_profile = - { - id: String, - name: String, - username: String, - affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, - automated_by: String, - business_account_affiliates_count: Integer, - community_role: String, - cover_picture: String, - created_at: String, - creator_subscriptions_count: Integer, - description: String, - favourites_count: Integer, - followers: Integer, - following: Integer, - has_custom_timelines: bool, - has_graduated_access: bool, - has_hidden_subscriptions_on_profile: bool, - highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, - identity_verification: XTwitterScraper::UserProfile::IdentityVerification, - is_automated: bool, - is_blue_verified: bool, - is_profile_translatable: bool, - is_translator: bool, - is_verified: bool, - location: String, - media_count: Integer, - parody_commentary_fan_label: String, - pinned_tweet_ids: ::Array[String], - possibly_sensitive: bool, - profile_bio: ::Hash[Symbol, top], - profile_banner_url: String, - profile_description_language: String, - profile_image_shape: String, - profile_interstitial_type: String, - profile_picture: String, - profile_sort_enabled: bool, - profile_translator_type: String, - protected: bool, - statuses_count: Integer, - super_follow_eligible: bool, - unavailable: bool, - unavailable_reason: String, - url: String, - verified: bool, - verified_type: String, - withheld_in_countries: ::Array[String] - } + type user_profile = ::Hash[Symbol, top] class UserProfile < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String @@ -64,7 +16,7 @@ module XTwitterScraper attr_reader affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel? def affiliates_highlighted_label=: ( - XTwitterScraper::UserProfile::AffiliatesHighlightedLabel + XTwitterScraper::UserProfile::AffiliatesHighlightedLabel | ::Hash[Symbol, top] ) -> XTwitterScraper::UserProfile::AffiliatesHighlightedLabel attr_reader automated_by: String? @@ -122,13 +74,13 @@ module XTwitterScraper attr_reader highlights_info: XTwitterScraper::UserProfile::HighlightsInfo? def highlights_info=: ( - XTwitterScraper::UserProfile::HighlightsInfo + XTwitterScraper::UserProfile::HighlightsInfo | ::Hash[Symbol, top] ) -> XTwitterScraper::UserProfile::HighlightsInfo attr_reader identity_verification: XTwitterScraper::UserProfile::IdentityVerification? def identity_verification=: ( - XTwitterScraper::UserProfile::IdentityVerification + XTwitterScraper::UserProfile::IdentityVerification | ::Hash[Symbol, top] ) -> XTwitterScraper::UserProfile::IdentityVerification attr_reader is_automated: bool? @@ -243,7 +195,7 @@ module XTwitterScraper id: String, name: String, username: String, - ?affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, + ?affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel | ::Hash[Symbol, top], ?automated_by: String, ?business_account_affiliates_count: Integer, ?community_role: String, @@ -257,8 +209,8 @@ module XTwitterScraper ?has_custom_timelines: bool, ?has_graduated_access: bool, ?has_hidden_subscriptions_on_profile: bool, - ?highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, - ?identity_verification: XTwitterScraper::UserProfile::IdentityVerification, + ?highlights_info: XTwitterScraper::UserProfile::HighlightsInfo | ::Hash[Symbol, top], + ?identity_verification: XTwitterScraper::UserProfile::IdentityVerification | ::Hash[Symbol, top], ?is_automated: bool, ?is_blue_verified: bool, ?is_profile_translatable: bool, @@ -288,64 +240,9 @@ module XTwitterScraper ?withheld_in_countries: ::Array[String] ) -> void - def to_hash: -> { - id: String, - name: String, - username: String, - affiliates_highlighted_label: XTwitterScraper::UserProfile::AffiliatesHighlightedLabel, - automated_by: String, - business_account_affiliates_count: Integer, - community_role: String, - cover_picture: String, - created_at: String, - creator_subscriptions_count: Integer, - description: String, - favourites_count: Integer, - followers: Integer, - following: Integer, - has_custom_timelines: bool, - has_graduated_access: bool, - has_hidden_subscriptions_on_profile: bool, - highlights_info: XTwitterScraper::UserProfile::HighlightsInfo, - identity_verification: XTwitterScraper::UserProfile::IdentityVerification, - is_automated: bool, - is_blue_verified: bool, - is_profile_translatable: bool, - is_translator: bool, - is_verified: bool, - location: String, - media_count: Integer, - parody_commentary_fan_label: String, - pinned_tweet_ids: ::Array[String], - possibly_sensitive: bool, - profile_bio: ::Hash[Symbol, top], - profile_banner_url: String, - profile_description_language: String, - profile_image_shape: String, - profile_interstitial_type: String, - profile_picture: String, - profile_sort_enabled: bool, - profile_translator_type: String, - protected: bool, - statuses_count: Integer, - super_follow_eligible: bool, - unavailable: bool, - unavailable_reason: String, - url: String, - verified: bool, - verified_type: String, - withheld_in_countries: ::Array[String] - } - - type affiliates_highlighted_label = - { - badge_url: String, - description: String, - url: String, - url_type: String, - user_label_display_type: String, - user_label_type: String - } + def to_hash: -> ::Hash[Symbol, top] + + type affiliates_highlighted_label = ::Hash[Symbol, top] class AffiliatesHighlightedLabel < XTwitterScraper::Internal::Type::BaseModel attr_reader badge_url: String? @@ -381,14 +278,7 @@ module XTwitterScraper ?user_label_type: String ) -> void - def to_hash: -> { - badge_url: String, - description: String, - url: String, - url_type: String, - user_label_display_type: String, - user_label_type: String - } + def to_hash: -> ::Hash[Symbol, top] end type highlights_info = @@ -408,18 +298,10 @@ module XTwitterScraper ?highlighted_tweets: String ) -> void - def to_hash: -> { - can_highlight_tweets: bool, - highlighted_tweets: String - } + def to_hash: -> ::Hash[Symbol, top] end - type identity_verification = - { - description: String, - is_identity_verified: bool, - verified_since_msec: String - } + type identity_verification = ::Hash[Symbol, top] class IdentityVerification < XTwitterScraper::Internal::Type::BaseModel attr_reader description: String? @@ -440,11 +322,7 @@ module XTwitterScraper ?verified_since_msec: String ) -> void - def to_hash: -> { - description: String, - is_identity_verified: bool, - verified_since_msec: String - } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs b/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs index 704f9ee..a845e77 100644 --- a/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +++ b/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs @@ -40,6 +40,14 @@ module XTwitterScraper poll_after_ms: Integer, status: :pending } + + module Object + X_ACCOUNT_CONNECTION_ATTEMPT: :x_account_connection_attempt + end + + module Status + PENDING: :pending + end end type success = @@ -67,6 +75,14 @@ module XTwitterScraper object: :x_account_connection_attempt, status: :success } + + module Object + X_ACCOUNT_CONNECTION_ATTEMPT: :x_account_connection_attempt + end + + module Status + SUCCESS: :success + end end type failed = @@ -111,6 +127,14 @@ module XTwitterScraper status: :failed, reason: String } + + module Object + X_ACCOUNT_CONNECTION_ATTEMPT: :x_account_connection_attempt + end + + module Status + FAILED: :failed + end end type requires_email_code = @@ -153,8 +177,21 @@ module XTwitterScraper status: :requires_email_code, username: String } + + module Object + X_ACCOUNT_CONNECTION_CHALLENGE: :x_account_connection_challenge + end + + module Status + REQUIRES_EMAIL_CODE: :requires_email_code + end end + XAccountConnectionAttemptPending: singleton(Pending) + XAccountConnectionAttemptSuccess: singleton(Success) + XAccountConnectionAttemptFailed: singleton(Failed) + XAccountConnectionChallenge: singleton(RequiresEmailCode) + def self?.variants: -> ::Array[XTwitterScraper::Models::X::account_connection_attempt_retrieve_response] end end diff --git a/sig/x_twitter_scraper/models/x/tweet_author.rbs b/sig/x_twitter_scraper/models/x/tweet_author.rbs index 7c6ff93..3b9b6ba 100644 --- a/sig/x_twitter_scraper/models/x/tweet_author.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_author.rbs @@ -5,7 +5,7 @@ module XTwitterScraper module Models module X - type tweet_author = { followers: Integer, verified: bool } + type tweet_author = ::Hash[Symbol, top] class TweetAuthor < XTwitterScraper::Models::UserProfile def followers: -> Integer @@ -16,9 +16,9 @@ module XTwitterScraper def verified=: (bool _) -> bool - def initialize: (followers: Integer, verified: bool) -> void + def initialize: (**untyped) -> void - def to_hash: -> { followers: Integer, verified: bool } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/sig/x_twitter_scraper/models/x/tweet_detail.rbs b/sig/x_twitter_scraper/models/x/tweet_detail.rbs index 86e90c1..3a650cb 100644 --- a/sig/x_twitter_scraper/models/x/tweet_detail.rbs +++ b/sig/x_twitter_scraper/models/x/tweet_detail.rbs @@ -5,47 +5,7 @@ module XTwitterScraper module Models module X - type tweet_detail = - { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - article: XTwitterScraper::X::TweetDetail::Article, - author: XTwitterScraper::X::TweetAuthor, - card: XTwitterScraper::X::TweetDetail::Card, - community_note: XTwitterScraper::X::TweetDetail::CommunityNote, - content_disclosure: XTwitterScraper::ContentDisclosure, - conversation_id: String, - created_at: String, - display_text_range: ::Array[Integer], - edit: XTwitterScraper::X::TweetDetail::Edit, - entities: ::Hash[Symbol, top], - in_reply_to_id: String, - in_reply_to_user_id: String, - in_reply_to_username: String, - is_limited_reply: bool, - is_note_tweet: bool, - is_quote_status: bool, - is_reply: bool, - is_translatable: bool, - lang: String, - media: ::Array[XTwitterScraper::TweetMedia], - note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, - place: XTwitterScraper::X::TweetDetail::Place, - possibly_sensitive: bool, - previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, - quoted_tweet: XTwitterScraper::EmbeddedTweet, - retweeted_tweet: XTwitterScraper::EmbeddedTweet, - source: String, - type: String, - url: String, - view_state: String - } + type tweet_detail = ::Hash[Symbol, top] class TweetDetail < XTwitterScraper::Internal::Type::BaseModel attr_accessor id: String @@ -67,31 +27,31 @@ module XTwitterScraper attr_reader article: XTwitterScraper::X::TweetDetail::Article? def article=: ( - XTwitterScraper::X::TweetDetail::Article + XTwitterScraper::X::TweetDetail::Article | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::Article attr_reader author: XTwitterScraper::X::TweetAuthor? def author=: ( - XTwitterScraper::X::TweetAuthor + XTwitterScraper::X::TweetAuthor | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetAuthor attr_reader card: XTwitterScraper::X::TweetDetail::Card? def card=: ( - XTwitterScraper::X::TweetDetail::Card + XTwitterScraper::X::TweetDetail::Card | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::Card attr_reader community_note: XTwitterScraper::X::TweetDetail::CommunityNote? def community_note=: ( - XTwitterScraper::X::TweetDetail::CommunityNote + XTwitterScraper::X::TweetDetail::CommunityNote | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::CommunityNote attr_reader content_disclosure: XTwitterScraper::ContentDisclosure? def content_disclosure=: ( - XTwitterScraper::ContentDisclosure + XTwitterScraper::ContentDisclosure | ::Hash[Symbol, top] ) -> XTwitterScraper::ContentDisclosure attr_reader conversation_id: String? @@ -109,7 +69,7 @@ module XTwitterScraper attr_reader edit: XTwitterScraper::X::TweetDetail::Edit? def edit=: ( - XTwitterScraper::X::TweetDetail::Edit + XTwitterScraper::X::TweetDetail::Edit | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::Edit attr_reader entities: ::Hash[Symbol, top]? @@ -161,13 +121,13 @@ module XTwitterScraper attr_reader note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet? def note_tweet=: ( - XTwitterScraper::X::TweetDetail::NoteTweet + XTwitterScraper::X::TweetDetail::NoteTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::NoteTweet attr_reader place: XTwitterScraper::X::TweetDetail::Place? def place=: ( - XTwitterScraper::X::TweetDetail::Place + XTwitterScraper::X::TweetDetail::Place | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::Place attr_reader possibly_sensitive: bool? @@ -177,19 +137,19 @@ module XTwitterScraper attr_reader previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts? def previous_counts=: ( - XTwitterScraper::X::TweetDetail::PreviousCounts + XTwitterScraper::X::TweetDetail::PreviousCounts | ::Hash[Symbol, top] ) -> XTwitterScraper::X::TweetDetail::PreviousCounts attr_reader quoted_tweet: XTwitterScraper::EmbeddedTweet? def quoted_tweet=: ( - XTwitterScraper::EmbeddedTweet + XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet attr_reader retweeted_tweet: XTwitterScraper::EmbeddedTweet? def retweeted_tweet=: ( - XTwitterScraper::EmbeddedTweet + XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top] ) -> XTwitterScraper::EmbeddedTweet attr_reader source: String? @@ -217,15 +177,15 @@ module XTwitterScraper retweet_count: Integer, text: String, view_count: Integer, - ?article: XTwitterScraper::X::TweetDetail::Article, - ?author: XTwitterScraper::X::TweetAuthor, - ?card: XTwitterScraper::X::TweetDetail::Card, - ?community_note: XTwitterScraper::X::TweetDetail::CommunityNote, - ?content_disclosure: XTwitterScraper::ContentDisclosure, + ?article: XTwitterScraper::X::TweetDetail::Article | ::Hash[Symbol, top], + ?author: XTwitterScraper::X::TweetAuthor | ::Hash[Symbol, top], + ?card: XTwitterScraper::X::TweetDetail::Card | ::Hash[Symbol, top], + ?community_note: XTwitterScraper::X::TweetDetail::CommunityNote | ::Hash[Symbol, top], + ?content_disclosure: XTwitterScraper::ContentDisclosure | ::Hash[Symbol, top], ?conversation_id: String, ?created_at: String, ?display_text_range: ::Array[Integer], - ?edit: XTwitterScraper::X::TweetDetail::Edit, + ?edit: XTwitterScraper::X::TweetDetail::Edit | ::Hash[Symbol, top], ?entities: ::Hash[Symbol, top], ?in_reply_to_id: String, ?in_reply_to_user_id: String, @@ -237,66 +197,21 @@ module XTwitterScraper ?is_translatable: bool, ?lang: String, ?media: ::Array[XTwitterScraper::TweetMedia], - ?note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, - ?place: XTwitterScraper::X::TweetDetail::Place, + ?note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet | ::Hash[Symbol, top], + ?place: XTwitterScraper::X::TweetDetail::Place | ::Hash[Symbol, top], ?possibly_sensitive: bool, - ?previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, - ?quoted_tweet: XTwitterScraper::EmbeddedTweet, - ?retweeted_tweet: XTwitterScraper::EmbeddedTweet, + ?previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts | ::Hash[Symbol, top], + ?quoted_tweet: XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top], + ?retweeted_tweet: XTwitterScraper::EmbeddedTweet | ::Hash[Symbol, top], ?source: String, ?type: String, ?url: String, ?view_state: String ) -> void - def to_hash: -> { - id: String, - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer, - text: String, - view_count: Integer, - article: XTwitterScraper::X::TweetDetail::Article, - author: XTwitterScraper::X::TweetAuthor, - card: XTwitterScraper::X::TweetDetail::Card, - community_note: XTwitterScraper::X::TweetDetail::CommunityNote, - content_disclosure: XTwitterScraper::ContentDisclosure, - conversation_id: String, - created_at: String, - display_text_range: ::Array[Integer], - edit: XTwitterScraper::X::TweetDetail::Edit, - entities: ::Hash[Symbol, top], - in_reply_to_id: String, - in_reply_to_user_id: String, - in_reply_to_username: String, - is_limited_reply: bool, - is_note_tweet: bool, - is_quote_status: bool, - is_reply: bool, - is_translatable: bool, - lang: String, - media: ::Array[XTwitterScraper::TweetMedia], - note_tweet: XTwitterScraper::X::TweetDetail::NoteTweet, - place: XTwitterScraper::X::TweetDetail::Place, - possibly_sensitive: bool, - previous_counts: XTwitterScraper::X::TweetDetail::PreviousCounts, - quoted_tweet: XTwitterScraper::EmbeddedTweet, - retweeted_tweet: XTwitterScraper::EmbeddedTweet, - source: String, - type: String, - url: String, - view_state: String - } - - type article = - { - id: String, - cover_media_url: String, - preview_text: String, - title: String - } + def to_hash: -> ::Hash[Symbol, top] + + type article = ::Hash[Symbol, top] class Article < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -322,21 +237,10 @@ module XTwitterScraper ?title: String ) -> void - def to_hash: -> { - id: String, - cover_media_url: String, - preview_text: String, - title: String - } + def to_hash: -> ::Hash[Symbol, top] end - type card = - { - id: String, - binding_values: ::Hash[Symbol, top], - name: String, - url: String - } + type card = ::Hash[Symbol, top] class Card < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -362,24 +266,10 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - id: String, - binding_values: ::Hash[Symbol, top], - name: String, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end - type community_note = - { - id: String, - destination_url: String, - footer: String, - short_title: String, - subtitle: String, - title: String, - visual_style: String - } + type community_note = ::Hash[Symbol, top] class CommunityNote < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -420,15 +310,7 @@ module XTwitterScraper ?visual_style: String ) -> void - def to_hash: -> { - id: String, - destination_url: String, - footer: String, - short_title: String, - subtitle: String, - title: String, - visual_style: String - } + def to_hash: -> ::Hash[Symbol, top] end type edit = @@ -448,20 +330,10 @@ module XTwitterScraper ?edit_tweet_ids: ::Array[String] ) -> void - def to_hash: -> { - editable_until_msecs: String, - edit_tweet_ids: ::Array[String] - } + def to_hash: -> ::Hash[Symbol, top] end - type note_tweet = - { - text: String, - id: String, - entities: ::Hash[Symbol, top], - is_expandable: bool, - richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] - } + type note_tweet = ::Hash[Symbol, top] class NoteTweet < XTwitterScraper::Internal::Type::BaseModel attr_accessor text: String @@ -492,13 +364,7 @@ module XTwitterScraper ?richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] ) -> void - def to_hash: -> { - text: String, - id: String, - entities: ::Hash[Symbol, top], - is_expandable: bool, - richtext_tags: ::Array[XTwitterScraper::X::TweetDetail::NoteTweet::RichtextTag] - } + def to_hash: -> ::Hash[Symbol, top] type richtext_tag = { from_index: Integer, to_index: Integer, types: ::Array[String] } @@ -516,25 +382,11 @@ module XTwitterScraper types: ::Array[String] ) -> void - def to_hash: -> { - from_index: Integer, - to_index: Integer, - types: ::Array[String] - } + def to_hash: -> ::Hash[Symbol, top] end end - type place = - { - id: String, - bounding_box: ::Hash[Symbol, top], - country: String, - country_code: String, - full_name: String, - name: String, - place_type: String, - url: String - } + type place = ::Hash[Symbol, top] class Place < XTwitterScraper::Internal::Type::BaseModel attr_reader id: String? @@ -580,26 +432,10 @@ module XTwitterScraper ?url: String ) -> void - def to_hash: -> { - id: String, - bounding_box: ::Hash[Symbol, top], - country: String, - country_code: String, - full_name: String, - name: String, - place_type: String, - url: String - } + def to_hash: -> ::Hash[Symbol, top] end - type previous_counts = - { - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer - } + type previous_counts = ::Hash[Symbol, top] class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel attr_reader bookmark_count: Integer? @@ -630,13 +466,7 @@ module XTwitterScraper ?retweet_count: Integer ) -> void - def to_hash: -> { - bookmark_count: Integer, - like_count: Integer, - quote_count: Integer, - reply_count: Integer, - retweet_count: Integer - } + def to_hash: -> ::Hash[Symbol, top] end end end diff --git a/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb b/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb index e582c9a..f4c0a88 100644 --- a/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb +++ b/test/x_twitter_scraper/resources/x/account_connection_attempts_test.rb @@ -3,6 +3,20 @@ require_relative "../../test_helper" class XTwitterScraper::Test::Resources::X::AccountConnectionAttemptsTest < XTwitterScraper::Test::ResourceTest + def test_legacy_variant_constants_remain_compatible + response = XTwitterScraper::Models::X::AccountConnectionAttemptRetrieveResponse + + assert_same(response::Pending, response::XAccountConnectionAttemptPending) + assert_same(response::Success, response::XAccountConnectionAttemptSuccess) + assert_same(response::Failed, response::XAccountConnectionAttemptFailed) + assert_same(response::RequiresEmailCode, response::XAccountConnectionChallenge) + assert_equal(:pending, response::XAccountConnectionAttemptPending::Status::PENDING) + assert_equal( + :x_account_connection_challenge, + response::XAccountConnectionChallenge::Object::X_ACCOUNT_CONNECTION_CHALLENGE + ) + end + def test_retrieve skip("Mock server tests are disabled")