x-twitter-scraper 0.5.5 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +1 -1
  4. data/lib/x_twitter_scraper/internal/type/union.rb +25 -9
  5. data/lib/x_twitter_scraper/models/compose_create_response.rb +62 -1
  6. data/lib/x_twitter_scraper/models/content_disclosure.rb +1 -9
  7. data/lib/x_twitter_scraper/models/embedded_tweet.rb +389 -1
  8. data/lib/x_twitter_scraper/models/paginated_tweets.rb +4 -5
  9. data/lib/x_twitter_scraper/models/radar_item.rb +144 -7
  10. data/lib/x_twitter_scraper/models/search_tweet.rb +371 -1
  11. data/lib/x_twitter_scraper/models/support/ticket_list_response.rb +30 -17
  12. data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +49 -24
  13. data/lib/x_twitter_scraper/models/support/ticket_update_response.rb +18 -6
  14. data/lib/x_twitter_scraper/models/trend_list_response.rb +28 -1
  15. data/lib/x_twitter_scraper/models/tweet_media.rb +213 -1
  16. data/lib/x_twitter_scraper/models/user_profile.rb +211 -21
  17. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rb +22 -0
  18. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +224 -0
  19. data/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +4 -4
  20. data/lib/x_twitter_scraper/models/x/account_create_params.rb +9 -9
  21. data/lib/x_twitter_scraper/models/x/account_create_response.rb +146 -54
  22. data/lib/x_twitter_scraper/models/x/account_reauth_params.rb +2 -2
  23. data/lib/x_twitter_scraper/models/x/account_reauth_response.rb +4 -4
  24. data/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb +3 -5
  25. data/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +3 -5
  26. data/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +1 -17
  27. data/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +3 -5
  28. data/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +3 -5
  29. data/lib/x_twitter_scraper/models/x/tweet_author.rb +14 -1
  30. data/lib/x_twitter_scraper/models/x/tweet_detail.rb +373 -1
  31. data/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +3 -5
  32. data/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +34 -6
  33. data/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb +345 -0
  34. data/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +3 -5
  35. data/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +3 -5
  36. data/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +3 -5
  37. data/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +3 -5
  38. data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +3 -5
  39. data/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +3 -5
  40. data/lib/x_twitter_scraper/models/x/x_account.rb +9 -9
  41. data/lib/x_twitter_scraper/models/x_get_article_response.rb +1 -7
  42. data/lib/x_twitter_scraper/models/x_get_trends_response.rb +28 -1
  43. data/lib/x_twitter_scraper/resources/compose.rb +4 -4
  44. data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +37 -0
  45. data/lib/x_twitter_scraper/resources/x/accounts.rb +5 -5
  46. data/lib/x_twitter_scraper/resources/x/communities/tweets.rb +2 -2
  47. data/lib/x_twitter_scraper/resources/x/communities.rb +1 -1
  48. data/lib/x_twitter_scraper/resources/x/lists.rb +1 -1
  49. data/lib/x_twitter_scraper/resources/x/tweets.rb +14 -11
  50. data/lib/x_twitter_scraper/resources/x/users.rb +5 -5
  51. data/lib/x_twitter_scraper/resources/x.rb +6 -0
  52. data/lib/x_twitter_scraper/version.rb +1 -1
  53. data/lib/x_twitter_scraper.rb +5 -1
  54. data/rbi/x_twitter_scraper/models/compose_create_response.rbi +142 -0
  55. data/rbi/x_twitter_scraper/models/content_disclosure.rbi +1 -15
  56. data/rbi/x_twitter_scraper/models/embedded_tweet.rbi +708 -3
  57. data/rbi/x_twitter_scraper/models/paginated_tweets.rbi +4 -5
  58. data/rbi/x_twitter_scraper/models/radar_item.rbi +245 -8
  59. data/rbi/x_twitter_scraper/models/search_tweet.rbi +674 -3
  60. data/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi +75 -55
  61. data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +129 -87
  62. data/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi +62 -13
  63. data/rbi/x_twitter_scraper/models/trend_list_response.rbi +40 -3
  64. data/rbi/x_twitter_scraper/models/tweet_media.rbi +313 -3
  65. data/rbi/x_twitter_scraper/models/user_profile.rbi +340 -29
  66. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rbi +40 -0
  67. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +295 -0
  68. data/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +6 -6
  69. data/rbi/x_twitter_scraper/models/x/account_create_params.rbi +8 -11
  70. data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +232 -91
  71. data/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +2 -2
  72. data/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +6 -6
  73. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi +4 -8
  74. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +4 -8
  75. data/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +0 -22
  76. data/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +4 -8
  77. data/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +4 -8
  78. data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +13 -3
  79. data/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +690 -3
  80. data/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +4 -8
  81. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +68 -8
  82. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi +527 -0
  83. data/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +4 -8
  84. data/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +4 -8
  85. data/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +4 -8
  86. data/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +4 -8
  87. data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +4 -8
  88. data/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +4 -8
  89. data/rbi/x_twitter_scraper/models/x/x_account.rbi +12 -12
  90. data/rbi/x_twitter_scraper/models/x_get_article_response.rbi +0 -9
  91. data/rbi/x_twitter_scraper/models/x_get_trends_response.rbi +40 -3
  92. data/rbi/x_twitter_scraper/resources/compose.rbi +4 -4
  93. data/rbi/x_twitter_scraper/resources/x/account_connection_attempts.rbi +33 -0
  94. data/rbi/x_twitter_scraper/resources/x/accounts.rbi +5 -5
  95. data/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +4 -8
  96. data/rbi/x_twitter_scraper/resources/x/communities.rbi +2 -4
  97. data/rbi/x_twitter_scraper/resources/x/lists.rbi +2 -4
  98. data/rbi/x_twitter_scraper/resources/x/tweets.rbi +20 -18
  99. data/rbi/x_twitter_scraper/resources/x/users.rbi +10 -20
  100. data/rbi/x_twitter_scraper/resources/x.rbi +4 -0
  101. data/sig/x_twitter_scraper/models/compose_create_response.rbs +60 -0
  102. data/sig/x_twitter_scraper/models/content_disclosure.rbs +1 -11
  103. data/sig/x_twitter_scraper/models/embedded_tweet.rbs +343 -62
  104. data/sig/x_twitter_scraper/models/radar_item.rbs +100 -4
  105. data/sig/x_twitter_scraper/models/search_tweet.rbs +333 -70
  106. data/sig/x_twitter_scraper/models/support/ticket_list_response.rbs +29 -32
  107. data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +49 -48
  108. data/sig/x_twitter_scraper/models/support/ticket_update_response.rbs +25 -7
  109. data/sig/x_twitter_scraper/models/trend_list_response.rbs +16 -20
  110. data/sig/x_twitter_scraper/models/tweet_media.rbs +146 -15
  111. data/sig/x_twitter_scraper/models/user_profile.rbs +164 -86
  112. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_params.rbs +25 -0
  113. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +199 -0
  114. data/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +5 -5
  115. data/sig/x_twitter_scraper/models/x/account_create_params.rbs +6 -8
  116. data/sig/x_twitter_scraper/models/x/account_create_response.rbs +144 -59
  117. data/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +5 -5
  118. data/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +0 -14
  119. data/sig/x_twitter_scraper/models/x/tweet_author.rbs +11 -3
  120. data/sig/x_twitter_scraper/models/x/tweet_detail.rbs +333 -70
  121. data/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +26 -0
  122. data/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs +274 -0
  123. data/sig/x_twitter_scraper/models/x_get_article_response.rbs +0 -7
  124. data/sig/x_twitter_scraper/models/x_get_trends_response.rbs +25 -3
  125. data/sig/x_twitter_scraper/resources/x/account_connection_attempts.rbs +14 -0
  126. data/sig/x_twitter_scraper/resources/x/accounts.rbs +2 -2
  127. data/sig/x_twitter_scraper/resources/x/tweets.rbs +3 -1
  128. data/sig/x_twitter_scraper/resources/x.rbs +2 -0
  129. metadata +14 -2
@@ -23,11 +23,10 @@ module XTwitterScraper
23
23
  required :tweets, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet] }
24
24
 
25
25
  # @!method initialize(has_next_page:, next_cursor:, tweets:)
26
- # Paginated tweet results. The item count can be lower than pageSize when the
27
- # source returns fewer tweets, filters remove tweets, or remaining credits cover
28
- # fewer results. Follow next_cursor while has_next_page is true. An empty page can
29
- # still have has_next_page true after filtering. Zero affordable results returns
30
- # 402 insufficient_credits.
26
+ # Paginated tweets. Source visibility, filters, or remaining credits can reduce
27
+ # results. An empty filtered page can still have has_next_page true. Follow
28
+ # next_cursor while has_next_page is true. Zero affordable results returns 402
29
+ # insufficient_credits.
31
30
  #
32
31
  # @param has_next_page [Boolean]
33
32
  # @param next_cursor [String]
@@ -24,6 +24,7 @@ module XTwitterScraper
24
24
  required :created_at, Time, api_name: :createdAt
25
25
 
26
26
  # @!attribute language
27
+ # BCP-47 language code. und means the source did not identify a language.
27
28
  #
28
29
  # @return [String]
29
30
  required :language, String
@@ -31,7 +32,18 @@ module XTwitterScraper
31
32
  # @!attribute metadata
32
33
  # Source-specific fields. Shape varies per source:
33
34
  #
34
- # - reddit: { subreddit: string, author: string }
35
+ # - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
36
+ # sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
37
+ # numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
38
+ # postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
39
+ # editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
40
+ # isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
41
+ # isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
42
+ # public net score. Exact public upvote and downvote counts are not available.
43
+ # Estimated counts derive from the public score and upvote ratio, which Reddit
44
+ # may fuzz. Comment bodies are not included. Current items combine public
45
+ # listing discovery with server-rendered post data and use `sourceFormat: html`;
46
+ # `json` and `rss` remain for legacy rows.
35
47
  # - github: { starsToday: number }
36
48
  # - hacker_news: { points: number, numberComments: number }
37
49
  # - google_trends: { approxTraffic: number }
@@ -39,10 +51,15 @@ module XTwitterScraper
39
51
  # - wikipedia: { views: number }
40
52
  # - trustmrr: { mrr, growthPercent, last30Days, total, customers,
41
53
  # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
42
- # growthMrrPercent?, multiple?, paymentProvider?, rank? }
54
+ # foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
55
+ # multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
56
+ # revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
57
+ # growth source, xHandle is the founder's X username without @. The rank field
58
+ # is the source's revenue rank. Result order represents reported 30-day
59
+ # revenue-growth rank.
43
60
  #
44
- # @return [Hash{Symbol=>Object}]
45
- required :metadata, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]
61
+ # @return [XTwitterScraper::Models::RadarItem::Metadata]
62
+ required :metadata, -> { XTwitterScraper::RadarItem::Metadata }
46
63
 
47
64
  # @!attribute published_at
48
65
  #
@@ -81,6 +98,7 @@ module XTwitterScraper
81
98
  optional :description, String
82
99
 
83
100
  # @!attribute image_url
101
+ # Source image. Startup growth items return the logo here.
84
102
  #
85
103
  # @return [String, nil]
86
104
  optional :image_url, String, api_name: :imageUrl
@@ -103,9 +121,9 @@ module XTwitterScraper
103
121
  #
104
122
  # @param created_at [Time]
105
123
  #
106
- # @param language [String]
124
+ # @param language [String] BCP-47 language code. und means the source did not identify a language.
107
125
  #
108
- # @param metadata [Hash{Symbol=>Object}] Source-specific fields. Shape varies per source:
126
+ # @param metadata [XTwitterScraper::Models::RadarItem::Metadata] Source-specific fields. Shape varies per source:
109
127
  #
110
128
  # @param published_at [Time]
111
129
  #
@@ -121,7 +139,7 @@ module XTwitterScraper
121
139
  #
122
140
  # @param description [String]
123
141
  #
124
- # @param image_url [String]
142
+ # @param image_url [String] Source image. Startup growth items return the logo here.
125
143
  #
126
144
  # @param url [String]
127
145
 
@@ -142,6 +160,125 @@ module XTwitterScraper
142
160
  # @return [Array<Symbol>]
143
161
  end
144
162
 
163
+ # @see XTwitterScraper::Models::RadarItem#metadata
164
+ class Metadata < XTwitterScraper::Internal::Type::BaseModel
165
+ # @!attribute author
166
+ #
167
+ # @return [String, nil]
168
+ optional :author, String
169
+
170
+ # @!attribute content_url
171
+ #
172
+ # @return [String, nil]
173
+ optional :content_url, String, api_name: :contentUrl
174
+
175
+ # @!attribute estimated_downvotes
176
+ #
177
+ # @return [Integer, nil]
178
+ optional :estimated_downvotes, Integer, api_name: :estimatedDownvotes
179
+
180
+ # @!attribute estimated_upvotes
181
+ #
182
+ # @return [Integer, nil]
183
+ optional :estimated_upvotes, Integer, api_name: :estimatedUpvotes
184
+
185
+ # @!attribute number_comments
186
+ #
187
+ # @return [Integer, nil]
188
+ optional :number_comments, Integer, api_name: :numberComments
189
+
190
+ # @!attribute score
191
+ #
192
+ # @return [Integer, nil]
193
+ optional :score, Integer
194
+
195
+ # @!attribute selftext
196
+ #
197
+ # @return [String, nil]
198
+ optional :selftext, String
199
+
200
+ # @!attribute source_format
201
+ # Current items use html. json and rss are retained for legacy rows.
202
+ #
203
+ # @return [Symbol, XTwitterScraper::Models::RadarItem::Metadata::SourceFormat, nil]
204
+ optional :source_format,
205
+ enum: -> { XTwitterScraper::RadarItem::Metadata::SourceFormat },
206
+ api_name: :sourceFormat
207
+
208
+ # @!attribute subreddit
209
+ #
210
+ # @return [String, nil]
211
+ optional :subreddit, String
212
+
213
+ # @!attribute upvote_ratio
214
+ #
215
+ # @return [Float, nil]
216
+ optional :upvote_ratio, Float, api_name: :upvoteRatio
217
+
218
+ # @!method initialize(author: nil, content_url: nil, estimated_downvotes: nil, estimated_upvotes: nil, number_comments: nil, score: nil, selftext: nil, source_format: nil, subreddit: nil, upvote_ratio: nil)
219
+ # Source-specific fields. Shape varies per source:
220
+ #
221
+ # - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
222
+ # sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
223
+ # numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
224
+ # postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
225
+ # editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
226
+ # isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
227
+ # isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
228
+ # public net score. Exact public upvote and downvote counts are not available.
229
+ # Estimated counts derive from the public score and upvote ratio, which Reddit
230
+ # may fuzz. Comment bodies are not included. Current items combine public
231
+ # listing discovery with server-rendered post data and use `sourceFormat: html`;
232
+ # `json` and `rss` remain for legacy rows.
233
+ # - github: { starsToday: number }
234
+ # - hacker_news: { points: number, numberComments: number }
235
+ # - google_trends: { approxTraffic: number }
236
+ # - polymarket: { volume24hr: number }
237
+ # - wikipedia: { views: number }
238
+ # - trustmrr: { mrr, growthPercent, last30Days, total, customers,
239
+ # activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
240
+ # foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
241
+ # multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
242
+ # revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
243
+ # growth source, xHandle is the founder's X username without @. The rank field
244
+ # is the source's revenue rank. Result order represents reported 30-day
245
+ # revenue-growth rank.
246
+ #
247
+ # @param author [String]
248
+ #
249
+ # @param content_url [String]
250
+ #
251
+ # @param estimated_downvotes [Integer]
252
+ #
253
+ # @param estimated_upvotes [Integer]
254
+ #
255
+ # @param number_comments [Integer]
256
+ #
257
+ # @param score [Integer]
258
+ #
259
+ # @param selftext [String]
260
+ #
261
+ # @param source_format [Symbol, XTwitterScraper::Models::RadarItem::Metadata::SourceFormat] Current items use html. json and rss are retained for legacy rows.
262
+ #
263
+ # @param subreddit [String]
264
+ #
265
+ # @param upvote_ratio [Float]
266
+
267
+ # Current items use html. json and rss are retained for legacy rows.
268
+ #
269
+ # @see XTwitterScraper::Models::RadarItem::Metadata#source_format
270
+ module SourceFormat
271
+ extend XTwitterScraper::Internal::Type::Enum
272
+
273
+ HTML = :html
274
+ JSON = :json
275
+ RSS = :rss
276
+
277
+ # @!method self.values
278
+ # @return [Array<Symbol>]
279
+ end
280
+ end
281
+
145
282
  # @see XTwitterScraper::Models::RadarItem#source
146
283
  module Source
147
284
  extend XTwitterScraper::Internal::Type::Enum
@@ -47,12 +47,30 @@ module XTwitterScraper
47
47
  # @return [Integer]
48
48
  required :view_count, Integer, api_name: :viewCount
49
49
 
50
+ # @!attribute article
51
+ # Article metadata attached to a tweet.
52
+ #
53
+ # @return [XTwitterScraper::Models::SearchTweet::Article, nil]
54
+ optional :article, -> { XTwitterScraper::SearchTweet::Article }
55
+
50
56
  # @!attribute author
51
57
  # X user profile with bio, follower counts, and verification status.
52
58
  #
53
59
  # @return [XTwitterScraper::Models::UserProfile, nil]
54
60
  optional :author, -> { XTwitterScraper::UserProfile }
55
61
 
62
+ # @!attribute card
63
+ # Public card metadata attached to a tweet.
64
+ #
65
+ # @return [XTwitterScraper::Models::SearchTweet::Card, nil]
66
+ optional :card, -> { XTwitterScraper::SearchTweet::Card }
67
+
68
+ # @!attribute community_note
69
+ # Community Note presentation metadata returned by X.
70
+ #
71
+ # @return [XTwitterScraper::Models::SearchTweet::CommunityNote, nil]
72
+ optional :community_note, -> { XTwitterScraper::SearchTweet::CommunityNote }, api_name: :communityNote
73
+
56
74
  # @!attribute content_disclosure
57
75
  # Content disclosure metadata shown by X when a tweet is labeled as paid
58
76
  # partnership content or AI-generated media.
@@ -79,6 +97,12 @@ module XTwitterScraper
79
97
  XTwitterScraper::Internal::Type::ArrayOf[Integer],
80
98
  api_name: :displayTextRange
81
99
 
100
+ # @!attribute edit
101
+ # Edit history metadata returned by X.
102
+ #
103
+ # @return [XTwitterScraper::Models::SearchTweet::Edit, nil]
104
+ optional :edit, -> { XTwitterScraper::SearchTweet::Edit }
105
+
82
106
  # @!attribute entities
83
107
  # Parsed search-result entities including URLs, mentions, hashtags, and media
84
108
  # markers
@@ -128,6 +152,11 @@ module XTwitterScraper
128
152
  # @return [Boolean, nil]
129
153
  optional :is_reply, XTwitterScraper::Internal::Type::Boolean, api_name: :isReply
130
154
 
155
+ # @!attribute is_translatable
156
+ #
157
+ # @return [Boolean, nil]
158
+ optional :is_translatable, XTwitterScraper::Internal::Type::Boolean, api_name: :isTranslatable
159
+
131
160
  # @!attribute lang
132
161
  # Search result language code.
133
162
  #
@@ -140,6 +169,33 @@ module XTwitterScraper
140
169
  # @return [Array<XTwitterScraper::Models::TweetMedia>, nil]
141
170
  optional :media, -> { XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::TweetMedia] }
142
171
 
172
+ # @!attribute note_tweet
173
+ # Complete Note Tweet content and rich-text metadata.
174
+ #
175
+ # @return [XTwitterScraper::Models::SearchTweet::NoteTweet, nil]
176
+ optional :note_tweet, -> { XTwitterScraper::SearchTweet::NoteTweet }, api_name: :noteTweet
177
+
178
+ # @!attribute place
179
+ # Public place metadata attached to a tweet.
180
+ #
181
+ # @return [XTwitterScraper::Models::SearchTweet::Place, nil]
182
+ optional :place, -> { XTwitterScraper::SearchTweet::Place }
183
+
184
+ # @!attribute possibly_sensitive
185
+ #
186
+ # @return [Boolean, nil]
187
+ optional :possibly_sensitive, XTwitterScraper::Internal::Type::Boolean, api_name: :possiblySensitive
188
+
189
+ # @!attribute previous_counts
190
+ # Engagement counts retained from a prior tweet edit.
191
+ #
192
+ # @return [XTwitterScraper::Models::SearchTweet::PreviousCounts, nil]
193
+ optional :previous_counts,
194
+ -> {
195
+ XTwitterScraper::SearchTweet::PreviousCounts
196
+ },
197
+ api_name: :previousCounts
198
+
143
199
  # @!attribute quoted_tweet
144
200
  # Quoted or retweeted tweet context. Every object includes id, text, and
145
201
  # engagement metrics. A zero metric can mean X did not report the count. Author,
@@ -173,7 +229,12 @@ module XTwitterScraper
173
229
  # @return [String, nil]
174
230
  optional :url, String
175
231
 
176
- # @!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)
232
+ # @!attribute view_state
233
+ #
234
+ # @return [String, nil]
235
+ optional :view_state, String, api_name: :viewState
236
+
237
+ # @!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)
177
238
  # Some parameter documentations has been truncated, see
178
239
  # {XTwitterScraper::Models::SearchTweet} for more details.
179
240
  #
@@ -196,8 +257,14 @@ module XTwitterScraper
196
257
  #
197
258
  # @param view_count [Integer]
198
259
  #
260
+ # @param article [XTwitterScraper::Models::SearchTweet::Article] Article metadata attached to a tweet.
261
+ #
199
262
  # @param author [XTwitterScraper::Models::UserProfile] X user profile with bio, follower counts, and verification status.
200
263
  #
264
+ # @param card [XTwitterScraper::Models::SearchTweet::Card] Public card metadata attached to a tweet.
265
+ #
266
+ # @param community_note [XTwitterScraper::Models::SearchTweet::CommunityNote] Community Note presentation metadata returned by X.
267
+ #
201
268
  # @param content_disclosure [XTwitterScraper::Models::ContentDisclosure] Content disclosure metadata shown by X when a tweet is labeled as paid partnersh
202
269
  #
203
270
  # @param conversation_id [String] Root tweet ID for the search result conversation
@@ -206,6 +273,8 @@ module XTwitterScraper
206
273
  #
207
274
  # @param display_text_range [Array<Integer>] Rendered text's start and end offsets.
208
275
  #
276
+ # @param edit [XTwitterScraper::Models::SearchTweet::Edit] Edit history metadata returned by X.
277
+ #
209
278
  # @param entities [Hash{Symbol=>Object}] Parsed search-result entities including URLs, mentions, hashtags, and media mark
210
279
  #
211
280
  # @param in_reply_to_id [String] ID of the tweet this result replies to.
@@ -222,10 +291,20 @@ module XTwitterScraper
222
291
  #
223
292
  # @param is_reply [Boolean] True when this search result is a reply
224
293
  #
294
+ # @param is_translatable [Boolean]
295
+ #
225
296
  # @param lang [String] Search result language code.
226
297
  #
227
298
  # @param media [Array<XTwitterScraper::Models::TweetMedia>] Search-result media attachments, omitted when no media is present
228
299
  #
300
+ # @param note_tweet [XTwitterScraper::Models::SearchTweet::NoteTweet] Complete Note Tweet content and rich-text metadata.
301
+ #
302
+ # @param place [XTwitterScraper::Models::SearchTweet::Place] Public place metadata attached to a tweet.
303
+ #
304
+ # @param possibly_sensitive [Boolean]
305
+ #
306
+ # @param previous_counts [XTwitterScraper::Models::SearchTweet::PreviousCounts] Engagement counts retained from a prior tweet edit.
307
+ #
229
308
  # @param quoted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen
230
309
  #
231
310
  # @param retweeted_tweet [XTwitterScraper::Models::EmbeddedTweet] Quoted or retweeted tweet context. Every object includes id, text, and engagemen
@@ -235,6 +314,297 @@ module XTwitterScraper
235
314
  # @param type [String]
236
315
  #
237
316
  # @param url [String] Search result permalink.
317
+ #
318
+ # @param view_state [String]
319
+
320
+ # @see XTwitterScraper::Models::SearchTweet#article
321
+ class Article < XTwitterScraper::Internal::Type::BaseModel
322
+ # @!attribute id
323
+ #
324
+ # @return [String, nil]
325
+ optional :id, String
326
+
327
+ # @!attribute cover_media_url
328
+ #
329
+ # @return [String, nil]
330
+ optional :cover_media_url, String, api_name: :coverMediaUrl
331
+
332
+ # @!attribute preview_text
333
+ #
334
+ # @return [String, nil]
335
+ optional :preview_text, String, api_name: :previewText
336
+
337
+ # @!attribute title
338
+ #
339
+ # @return [String, nil]
340
+ optional :title, String
341
+
342
+ # @!method initialize(id: nil, cover_media_url: nil, preview_text: nil, title: nil)
343
+ # Article metadata attached to a tweet.
344
+ #
345
+ # @param id [String]
346
+ # @param cover_media_url [String]
347
+ # @param preview_text [String]
348
+ # @param title [String]
349
+ end
350
+
351
+ # @see XTwitterScraper::Models::SearchTweet#card
352
+ class Card < XTwitterScraper::Internal::Type::BaseModel
353
+ # @!attribute id
354
+ #
355
+ # @return [String, nil]
356
+ optional :id, String
357
+
358
+ # @!attribute binding_values
359
+ #
360
+ # @return [Hash{Symbol=>Object}, nil]
361
+ optional :binding_values,
362
+ XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown],
363
+ api_name: :bindingValues
364
+
365
+ # @!attribute name
366
+ #
367
+ # @return [String, nil]
368
+ optional :name, String
369
+
370
+ # @!attribute url
371
+ #
372
+ # @return [String, nil]
373
+ optional :url, String
374
+
375
+ # @!method initialize(id: nil, binding_values: nil, name: nil, url: nil)
376
+ # Public card metadata attached to a tweet.
377
+ #
378
+ # @param id [String]
379
+ # @param binding_values [Hash{Symbol=>Object}]
380
+ # @param name [String]
381
+ # @param url [String]
382
+ end
383
+
384
+ # @see XTwitterScraper::Models::SearchTweet#community_note
385
+ class CommunityNote < XTwitterScraper::Internal::Type::BaseModel
386
+ # @!attribute id
387
+ #
388
+ # @return [String, nil]
389
+ optional :id, String
390
+
391
+ # @!attribute destination_url
392
+ #
393
+ # @return [String, nil]
394
+ optional :destination_url, String, api_name: :destinationUrl
395
+
396
+ # @!attribute footer
397
+ #
398
+ # @return [String, nil]
399
+ optional :footer, String
400
+
401
+ # @!attribute short_title
402
+ #
403
+ # @return [String, nil]
404
+ optional :short_title, String, api_name: :shortTitle
405
+
406
+ # @!attribute subtitle
407
+ #
408
+ # @return [String, nil]
409
+ optional :subtitle, String
410
+
411
+ # @!attribute title
412
+ #
413
+ # @return [String, nil]
414
+ optional :title, String
415
+
416
+ # @!attribute visual_style
417
+ #
418
+ # @return [String, nil]
419
+ optional :visual_style, String, api_name: :visualStyle
420
+
421
+ # @!method initialize(id: nil, destination_url: nil, footer: nil, short_title: nil, subtitle: nil, title: nil, visual_style: nil)
422
+ # Community Note presentation metadata returned by X.
423
+ #
424
+ # @param id [String]
425
+ # @param destination_url [String]
426
+ # @param footer [String]
427
+ # @param short_title [String]
428
+ # @param subtitle [String]
429
+ # @param title [String]
430
+ # @param visual_style [String]
431
+ end
432
+
433
+ # @see XTwitterScraper::Models::SearchTweet#edit
434
+ class Edit < XTwitterScraper::Internal::Type::BaseModel
435
+ # @!attribute editable_until_msecs
436
+ #
437
+ # @return [String, nil]
438
+ optional :editable_until_msecs, String, api_name: :editableUntilMsecs
439
+
440
+ # @!attribute edit_tweet_ids
441
+ #
442
+ # @return [Array<String>, nil]
443
+ optional :edit_tweet_ids, XTwitterScraper::Internal::Type::ArrayOf[String], api_name: :editTweetIds
444
+
445
+ # @!method initialize(editable_until_msecs: nil, edit_tweet_ids: nil)
446
+ # Edit history metadata returned by X.
447
+ #
448
+ # @param editable_until_msecs [String]
449
+ # @param edit_tweet_ids [Array<String>]
450
+ end
451
+
452
+ # @see XTwitterScraper::Models::SearchTweet#note_tweet
453
+ class NoteTweet < XTwitterScraper::Internal::Type::BaseModel
454
+ # @!attribute text
455
+ #
456
+ # @return [String]
457
+ required :text, String
458
+
459
+ # @!attribute id
460
+ #
461
+ # @return [String, nil]
462
+ optional :id, String
463
+
464
+ # @!attribute entities
465
+ #
466
+ # @return [Hash{Symbol=>Object}, nil]
467
+ optional :entities, XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown]
468
+
469
+ # @!attribute is_expandable
470
+ #
471
+ # @return [Boolean, nil]
472
+ optional :is_expandable, XTwitterScraper::Internal::Type::Boolean, api_name: :isExpandable
473
+
474
+ # @!attribute richtext_tags
475
+ #
476
+ # @return [Array<XTwitterScraper::Models::SearchTweet::NoteTweet::RichtextTag>, nil]
477
+ optional :richtext_tags,
478
+ -> {
479
+ XTwitterScraper::Internal::Type::ArrayOf[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag]
480
+ },
481
+ api_name: :richtextTags
482
+
483
+ # @!method initialize(text:, id: nil, entities: nil, is_expandable: nil, richtext_tags: nil)
484
+ # Complete Note Tweet content and rich-text metadata.
485
+ #
486
+ # @param text [String]
487
+ # @param id [String]
488
+ # @param entities [Hash{Symbol=>Object}]
489
+ # @param is_expandable [Boolean]
490
+ # @param richtext_tags [Array<XTwitterScraper::Models::SearchTweet::NoteTweet::RichtextTag>]
491
+
492
+ class RichtextTag < XTwitterScraper::Internal::Type::BaseModel
493
+ # @!attribute from_index
494
+ #
495
+ # @return [Integer]
496
+ required :from_index, Integer, api_name: :fromIndex
497
+
498
+ # @!attribute to_index
499
+ #
500
+ # @return [Integer]
501
+ required :to_index, Integer, api_name: :toIndex
502
+
503
+ # @!attribute types
504
+ #
505
+ # @return [Array<String>]
506
+ required :types, XTwitterScraper::Internal::Type::ArrayOf[String]
507
+
508
+ # @!method initialize(from_index:, to_index:, types:)
509
+ # @param from_index [Integer]
510
+ # @param to_index [Integer]
511
+ # @param types [Array<String>]
512
+ end
513
+ end
514
+
515
+ # @see XTwitterScraper::Models::SearchTweet#place
516
+ class Place < XTwitterScraper::Internal::Type::BaseModel
517
+ # @!attribute id
518
+ #
519
+ # @return [String, nil]
520
+ optional :id, String
521
+
522
+ # @!attribute bounding_box
523
+ #
524
+ # @return [Hash{Symbol=>Object}, nil]
525
+ optional :bounding_box,
526
+ XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::Unknown],
527
+ api_name: :boundingBox
528
+
529
+ # @!attribute country
530
+ #
531
+ # @return [String, nil]
532
+ optional :country, String
533
+
534
+ # @!attribute country_code
535
+ #
536
+ # @return [String, nil]
537
+ optional :country_code, String, api_name: :countryCode
538
+
539
+ # @!attribute full_name
540
+ #
541
+ # @return [String, nil]
542
+ optional :full_name, String, api_name: :fullName
543
+
544
+ # @!attribute name
545
+ #
546
+ # @return [String, nil]
547
+ optional :name, String
548
+
549
+ # @!attribute place_type
550
+ #
551
+ # @return [String, nil]
552
+ optional :place_type, String, api_name: :placeType
553
+
554
+ # @!attribute url
555
+ #
556
+ # @return [String, nil]
557
+ optional :url, String
558
+
559
+ # @!method initialize(id: nil, bounding_box: nil, country: nil, country_code: nil, full_name: nil, name: nil, place_type: nil, url: nil)
560
+ # Public place metadata attached to a tweet.
561
+ #
562
+ # @param id [String]
563
+ # @param bounding_box [Hash{Symbol=>Object}]
564
+ # @param country [String]
565
+ # @param country_code [String]
566
+ # @param full_name [String]
567
+ # @param name [String]
568
+ # @param place_type [String]
569
+ # @param url [String]
570
+ end
571
+
572
+ # @see XTwitterScraper::Models::SearchTweet#previous_counts
573
+ class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel
574
+ # @!attribute bookmark_count
575
+ #
576
+ # @return [Integer, nil]
577
+ optional :bookmark_count, Integer, api_name: :bookmarkCount
578
+
579
+ # @!attribute like_count
580
+ #
581
+ # @return [Integer, nil]
582
+ optional :like_count, Integer, api_name: :likeCount
583
+
584
+ # @!attribute quote_count
585
+ #
586
+ # @return [Integer, nil]
587
+ optional :quote_count, Integer, api_name: :quoteCount
588
+
589
+ # @!attribute reply_count
590
+ #
591
+ # @return [Integer, nil]
592
+ optional :reply_count, Integer, api_name: :replyCount
593
+
594
+ # @!attribute retweet_count
595
+ #
596
+ # @return [Integer, nil]
597
+ optional :retweet_count, Integer, api_name: :retweetCount
598
+
599
+ # @!method initialize(bookmark_count: nil, like_count: nil, quote_count: nil, reply_count: nil, retweet_count: nil)
600
+ # Engagement counts retained from a prior tweet edit.
601
+ #
602
+ # @param bookmark_count [Integer]
603
+ # @param like_count [Integer]
604
+ # @param quote_count [Integer]
605
+ # @param reply_count [Integer]
606
+ # @param retweet_count [Integer]
607
+ end
238
608
  end
239
609
  end
240
610
  end