x-twitter-scraper 0.6.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/lib/x_twitter_scraper/internal/type/union.rb +25 -9
- data/lib/x_twitter_scraper/models/content_disclosure.rb +1 -9
- data/lib/x_twitter_scraper/models/embedded_tweet.rb +389 -1
- data/lib/x_twitter_scraper/models/paginated_tweets.rb +4 -5
- data/lib/x_twitter_scraper/models/search_tweet.rb +371 -1
- data/lib/x_twitter_scraper/models/support/ticket_list_response.rb +30 -17
- data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +49 -24
- data/lib/x_twitter_scraper/models/support/ticket_update_response.rb +18 -6
- data/lib/x_twitter_scraper/models/trend_list_response.rb +28 -1
- data/lib/x_twitter_scraper/models/tweet_media.rb +213 -1
- data/lib/x_twitter_scraper/models/user_profile.rb +211 -21
- data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +60 -26
- data/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +4 -4
- data/lib/x_twitter_scraper/models/x/account_create_response.rb +149 -2
- data/lib/x_twitter_scraper/models/x/account_reauth_response.rb +4 -4
- data/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +1 -17
- data/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/tweet_author.rb +14 -1
- data/lib/x_twitter_scraper/models/x/tweet_detail.rb +373 -1
- data/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +34 -6
- data/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb +345 -0
- data/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +3 -5
- data/lib/x_twitter_scraper/models/x_get_article_response.rb +1 -7
- data/lib/x_twitter_scraper/models/x_get_trends_response.rb +28 -1
- data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +1 -1
- data/lib/x_twitter_scraper/resources/x/accounts.rb +2 -2
- data/lib/x_twitter_scraper/resources/x/communities/tweets.rb +2 -2
- data/lib/x_twitter_scraper/resources/x/communities.rb +1 -1
- data/lib/x_twitter_scraper/resources/x/lists.rb +1 -1
- data/lib/x_twitter_scraper/resources/x/tweets.rb +14 -11
- data/lib/x_twitter_scraper/resources/x/users.rb +5 -5
- data/lib/x_twitter_scraper/version.rb +1 -1
- data/lib/x_twitter_scraper.rb +2 -1
- data/rbi/x_twitter_scraper/models/content_disclosure.rbi +1 -15
- data/rbi/x_twitter_scraper/models/embedded_tweet.rbi +708 -3
- data/rbi/x_twitter_scraper/models/paginated_tweets.rbi +4 -5
- data/rbi/x_twitter_scraper/models/search_tweet.rbi +674 -3
- data/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi +75 -55
- data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +129 -87
- data/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi +62 -13
- data/rbi/x_twitter_scraper/models/trend_list_response.rbi +40 -3
- data/rbi/x_twitter_scraper/models/tweet_media.rbi +313 -3
- data/rbi/x_twitter_scraper/models/user_profile.rbi +340 -29
- data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +61 -83
- data/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +6 -6
- data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +264 -2
- data/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +6 -6
- data/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +0 -22
- data/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +13 -3
- data/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +690 -3
- data/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +68 -8
- data/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi +527 -0
- data/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +4 -8
- data/rbi/x_twitter_scraper/models/x_get_article_response.rbi +0 -9
- data/rbi/x_twitter_scraper/models/x_get_trends_response.rbi +40 -3
- data/rbi/x_twitter_scraper/resources/x/accounts.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +4 -8
- data/rbi/x_twitter_scraper/resources/x/communities.rbi +2 -4
- data/rbi/x_twitter_scraper/resources/x/lists.rbi +2 -4
- data/rbi/x_twitter_scraper/resources/x/tweets.rbi +20 -18
- data/rbi/x_twitter_scraper/resources/x/users.rbi +10 -20
- data/sig/x_twitter_scraper/models/content_disclosure.rbs +1 -11
- data/sig/x_twitter_scraper/models/embedded_tweet.rbs +343 -62
- data/sig/x_twitter_scraper/models/search_tweet.rbs +333 -70
- data/sig/x_twitter_scraper/models/support/ticket_list_response.rbs +29 -32
- data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +49 -48
- data/sig/x_twitter_scraper/models/support/ticket_update_response.rbs +25 -7
- data/sig/x_twitter_scraper/models/trend_list_response.rbs +16 -20
- data/sig/x_twitter_scraper/models/tweet_media.rbs +146 -15
- data/sig/x_twitter_scraper/models/user_profile.rbs +164 -86
- data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +50 -33
- data/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +5 -5
- data/sig/x_twitter_scraper/models/x/account_create_response.rbs +147 -1
- data/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +5 -5
- data/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +0 -14
- data/sig/x_twitter_scraper/models/x/tweet_author.rbs +11 -3
- data/sig/x_twitter_scraper/models/x/tweet_detail.rbs +333 -70
- data/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +26 -0
- data/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs +274 -0
- data/sig/x_twitter_scraper/models/x_get_article_response.rbs +0 -7
- data/sig/x_twitter_scraper/models/x_get_trends_response.rbs +25 -3
- data/sig/x_twitter_scraper/resources/x/accounts.rbs +1 -1
- data/sig/x_twitter_scraper/resources/x/tweets.rbs +3 -1
- metadata +4 -1
|
@@ -39,6 +39,15 @@ module XTwitterScraper
|
|
|
39
39
|
sig { returns(Integer) }
|
|
40
40
|
attr_accessor :view_count
|
|
41
41
|
|
|
42
|
+
# Article metadata attached to a tweet.
|
|
43
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::Article)) }
|
|
44
|
+
attr_reader :article
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
params(article: XTwitterScraper::SearchTweet::Article::OrHash).void
|
|
48
|
+
end
|
|
49
|
+
attr_writer :article
|
|
50
|
+
|
|
42
51
|
# X user profile with bio, follower counts, and verification status.
|
|
43
52
|
sig { returns(T.nilable(XTwitterScraper::UserProfile)) }
|
|
44
53
|
attr_reader :author
|
|
@@ -46,6 +55,24 @@ module XTwitterScraper
|
|
|
46
55
|
sig { params(author: XTwitterScraper::UserProfile::OrHash).void }
|
|
47
56
|
attr_writer :author
|
|
48
57
|
|
|
58
|
+
# Public card metadata attached to a tweet.
|
|
59
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::Card)) }
|
|
60
|
+
attr_reader :card
|
|
61
|
+
|
|
62
|
+
sig { params(card: XTwitterScraper::SearchTweet::Card::OrHash).void }
|
|
63
|
+
attr_writer :card
|
|
64
|
+
|
|
65
|
+
# Community Note presentation metadata returned by X.
|
|
66
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::CommunityNote)) }
|
|
67
|
+
attr_reader :community_note
|
|
68
|
+
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
community_note: XTwitterScraper::SearchTweet::CommunityNote::OrHash
|
|
72
|
+
).void
|
|
73
|
+
end
|
|
74
|
+
attr_writer :community_note
|
|
75
|
+
|
|
49
76
|
# Content disclosure metadata shown by X when a tweet is labeled as paid
|
|
50
77
|
# partnership content or AI-generated media.
|
|
51
78
|
sig { returns(T.nilable(XTwitterScraper::ContentDisclosure)) }
|
|
@@ -78,6 +105,13 @@ module XTwitterScraper
|
|
|
78
105
|
sig { params(display_text_range: T::Array[Integer]).void }
|
|
79
106
|
attr_writer :display_text_range
|
|
80
107
|
|
|
108
|
+
# Edit history metadata returned by X.
|
|
109
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::Edit)) }
|
|
110
|
+
attr_reader :edit
|
|
111
|
+
|
|
112
|
+
sig { params(edit: XTwitterScraper::SearchTweet::Edit::OrHash).void }
|
|
113
|
+
attr_writer :edit
|
|
114
|
+
|
|
81
115
|
# Parsed search-result entities including URLs, mentions, hashtags, and media
|
|
82
116
|
# markers
|
|
83
117
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
@@ -135,6 +169,12 @@ module XTwitterScraper
|
|
|
135
169
|
sig { params(is_reply: T::Boolean).void }
|
|
136
170
|
attr_writer :is_reply
|
|
137
171
|
|
|
172
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
173
|
+
attr_reader :is_translatable
|
|
174
|
+
|
|
175
|
+
sig { params(is_translatable: T::Boolean).void }
|
|
176
|
+
attr_writer :is_translatable
|
|
177
|
+
|
|
138
178
|
# Search result language code.
|
|
139
179
|
sig { returns(T.nilable(String)) }
|
|
140
180
|
attr_reader :lang
|
|
@@ -149,6 +189,39 @@ module XTwitterScraper
|
|
|
149
189
|
sig { params(media: T::Array[XTwitterScraper::TweetMedia::OrHash]).void }
|
|
150
190
|
attr_writer :media
|
|
151
191
|
|
|
192
|
+
# Complete Note Tweet content and rich-text metadata.
|
|
193
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::NoteTweet)) }
|
|
194
|
+
attr_reader :note_tweet
|
|
195
|
+
|
|
196
|
+
sig do
|
|
197
|
+
params(note_tweet: XTwitterScraper::SearchTweet::NoteTweet::OrHash).void
|
|
198
|
+
end
|
|
199
|
+
attr_writer :note_tweet
|
|
200
|
+
|
|
201
|
+
# Public place metadata attached to a tweet.
|
|
202
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::Place)) }
|
|
203
|
+
attr_reader :place
|
|
204
|
+
|
|
205
|
+
sig { params(place: XTwitterScraper::SearchTweet::Place::OrHash).void }
|
|
206
|
+
attr_writer :place
|
|
207
|
+
|
|
208
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
209
|
+
attr_reader :possibly_sensitive
|
|
210
|
+
|
|
211
|
+
sig { params(possibly_sensitive: T::Boolean).void }
|
|
212
|
+
attr_writer :possibly_sensitive
|
|
213
|
+
|
|
214
|
+
# Engagement counts retained from a prior tweet edit.
|
|
215
|
+
sig { returns(T.nilable(XTwitterScraper::SearchTweet::PreviousCounts)) }
|
|
216
|
+
attr_reader :previous_counts
|
|
217
|
+
|
|
218
|
+
sig do
|
|
219
|
+
params(
|
|
220
|
+
previous_counts: XTwitterScraper::SearchTweet::PreviousCounts::OrHash
|
|
221
|
+
).void
|
|
222
|
+
end
|
|
223
|
+
attr_writer :previous_counts
|
|
224
|
+
|
|
152
225
|
# Quoted or retweeted tweet context. Every object includes id, text, and
|
|
153
226
|
# engagement metrics. A zero metric can mean X did not report the count. Author,
|
|
154
227
|
# media, and conversation fields appear when available.
|
|
@@ -189,6 +262,12 @@ module XTwitterScraper
|
|
|
189
262
|
sig { params(url: String).void }
|
|
190
263
|
attr_writer :url
|
|
191
264
|
|
|
265
|
+
sig { returns(T.nilable(String)) }
|
|
266
|
+
attr_reader :view_state
|
|
267
|
+
|
|
268
|
+
sig { params(view_state: String).void }
|
|
269
|
+
attr_writer :view_state
|
|
270
|
+
|
|
192
271
|
# Tweet returned from search results with inline author info. A zero metric can
|
|
193
272
|
# mean X did not report the count.
|
|
194
273
|
sig do
|
|
@@ -201,11 +280,15 @@ module XTwitterScraper
|
|
|
201
280
|
retweet_count: Integer,
|
|
202
281
|
text: String,
|
|
203
282
|
view_count: Integer,
|
|
283
|
+
article: XTwitterScraper::SearchTweet::Article::OrHash,
|
|
204
284
|
author: XTwitterScraper::UserProfile::OrHash,
|
|
285
|
+
card: XTwitterScraper::SearchTweet::Card::OrHash,
|
|
286
|
+
community_note: XTwitterScraper::SearchTweet::CommunityNote::OrHash,
|
|
205
287
|
content_disclosure: XTwitterScraper::ContentDisclosure::OrHash,
|
|
206
288
|
conversation_id: String,
|
|
207
289
|
created_at: String,
|
|
208
290
|
display_text_range: T::Array[Integer],
|
|
291
|
+
edit: XTwitterScraper::SearchTweet::Edit::OrHash,
|
|
209
292
|
entities: T::Hash[Symbol, T.anything],
|
|
210
293
|
in_reply_to_id: String,
|
|
211
294
|
in_reply_to_user_id: String,
|
|
@@ -214,13 +297,19 @@ module XTwitterScraper
|
|
|
214
297
|
is_note_tweet: T::Boolean,
|
|
215
298
|
is_quote_status: T::Boolean,
|
|
216
299
|
is_reply: T::Boolean,
|
|
300
|
+
is_translatable: T::Boolean,
|
|
217
301
|
lang: String,
|
|
218
302
|
media: T::Array[XTwitterScraper::TweetMedia::OrHash],
|
|
303
|
+
note_tweet: XTwitterScraper::SearchTweet::NoteTweet::OrHash,
|
|
304
|
+
place: XTwitterScraper::SearchTweet::Place::OrHash,
|
|
305
|
+
possibly_sensitive: T::Boolean,
|
|
306
|
+
previous_counts: XTwitterScraper::SearchTweet::PreviousCounts::OrHash,
|
|
219
307
|
quoted_tweet: XTwitterScraper::EmbeddedTweet::OrHash,
|
|
220
308
|
retweeted_tweet: XTwitterScraper::EmbeddedTweet::OrHash,
|
|
221
309
|
source: String,
|
|
222
310
|
type: String,
|
|
223
|
-
url: String
|
|
311
|
+
url: String,
|
|
312
|
+
view_state: String
|
|
224
313
|
).returns(T.attached_class)
|
|
225
314
|
end
|
|
226
315
|
def self.new(
|
|
@@ -232,8 +321,14 @@ module XTwitterScraper
|
|
|
232
321
|
retweet_count:,
|
|
233
322
|
text:,
|
|
234
323
|
view_count:,
|
|
324
|
+
# Article metadata attached to a tweet.
|
|
325
|
+
article: nil,
|
|
235
326
|
# X user profile with bio, follower counts, and verification status.
|
|
236
327
|
author: nil,
|
|
328
|
+
# Public card metadata attached to a tweet.
|
|
329
|
+
card: nil,
|
|
330
|
+
# Community Note presentation metadata returned by X.
|
|
331
|
+
community_note: nil,
|
|
237
332
|
# Content disclosure metadata shown by X when a tweet is labeled as paid
|
|
238
333
|
# partnership content or AI-generated media.
|
|
239
334
|
content_disclosure: nil,
|
|
@@ -242,6 +337,8 @@ module XTwitterScraper
|
|
|
242
337
|
created_at: nil,
|
|
243
338
|
# Rendered text's start and end offsets.
|
|
244
339
|
display_text_range: nil,
|
|
340
|
+
# Edit history metadata returned by X.
|
|
341
|
+
edit: nil,
|
|
245
342
|
# Parsed search-result entities including URLs, mentions, hashtags, and media
|
|
246
343
|
# markers
|
|
247
344
|
entities: nil,
|
|
@@ -259,10 +356,18 @@ module XTwitterScraper
|
|
|
259
356
|
is_quote_status: nil,
|
|
260
357
|
# True when this search result is a reply
|
|
261
358
|
is_reply: nil,
|
|
359
|
+
is_translatable: nil,
|
|
262
360
|
# Search result language code.
|
|
263
361
|
lang: nil,
|
|
264
362
|
# Search-result media attachments, omitted when no media is present
|
|
265
363
|
media: nil,
|
|
364
|
+
# Complete Note Tweet content and rich-text metadata.
|
|
365
|
+
note_tweet: nil,
|
|
366
|
+
# Public place metadata attached to a tweet.
|
|
367
|
+
place: nil,
|
|
368
|
+
possibly_sensitive: nil,
|
|
369
|
+
# Engagement counts retained from a prior tweet edit.
|
|
370
|
+
previous_counts: nil,
|
|
266
371
|
# Quoted or retweeted tweet context. Every object includes id, text, and
|
|
267
372
|
# engagement metrics. A zero metric can mean X did not report the count. Author,
|
|
268
373
|
# media, and conversation fields appear when available.
|
|
@@ -275,7 +380,8 @@ module XTwitterScraper
|
|
|
275
380
|
source: nil,
|
|
276
381
|
type: nil,
|
|
277
382
|
# Search result permalink.
|
|
278
|
-
url: nil
|
|
383
|
+
url: nil,
|
|
384
|
+
view_state: nil
|
|
279
385
|
)
|
|
280
386
|
end
|
|
281
387
|
|
|
@@ -290,11 +396,15 @@ module XTwitterScraper
|
|
|
290
396
|
retweet_count: Integer,
|
|
291
397
|
text: String,
|
|
292
398
|
view_count: Integer,
|
|
399
|
+
article: XTwitterScraper::SearchTweet::Article,
|
|
293
400
|
author: XTwitterScraper::UserProfile,
|
|
401
|
+
card: XTwitterScraper::SearchTweet::Card,
|
|
402
|
+
community_note: XTwitterScraper::SearchTweet::CommunityNote,
|
|
294
403
|
content_disclosure: XTwitterScraper::ContentDisclosure,
|
|
295
404
|
conversation_id: String,
|
|
296
405
|
created_at: String,
|
|
297
406
|
display_text_range: T::Array[Integer],
|
|
407
|
+
edit: XTwitterScraper::SearchTweet::Edit,
|
|
298
408
|
entities: T::Hash[Symbol, T.anything],
|
|
299
409
|
in_reply_to_id: String,
|
|
300
410
|
in_reply_to_user_id: String,
|
|
@@ -303,18 +413,579 @@ module XTwitterScraper
|
|
|
303
413
|
is_note_tweet: T::Boolean,
|
|
304
414
|
is_quote_status: T::Boolean,
|
|
305
415
|
is_reply: T::Boolean,
|
|
416
|
+
is_translatable: T::Boolean,
|
|
306
417
|
lang: String,
|
|
307
418
|
media: T::Array[XTwitterScraper::TweetMedia],
|
|
419
|
+
note_tweet: XTwitterScraper::SearchTweet::NoteTweet,
|
|
420
|
+
place: XTwitterScraper::SearchTweet::Place,
|
|
421
|
+
possibly_sensitive: T::Boolean,
|
|
422
|
+
previous_counts: XTwitterScraper::SearchTweet::PreviousCounts,
|
|
308
423
|
quoted_tweet: XTwitterScraper::EmbeddedTweet,
|
|
309
424
|
retweeted_tweet: XTwitterScraper::EmbeddedTweet,
|
|
310
425
|
source: String,
|
|
311
426
|
type: String,
|
|
312
|
-
url: String
|
|
427
|
+
url: String,
|
|
428
|
+
view_state: String
|
|
313
429
|
}
|
|
314
430
|
)
|
|
315
431
|
end
|
|
316
432
|
def to_hash
|
|
317
433
|
end
|
|
434
|
+
|
|
435
|
+
class Article < XTwitterScraper::Internal::Type::BaseModel
|
|
436
|
+
OrHash =
|
|
437
|
+
T.type_alias do
|
|
438
|
+
T.any(
|
|
439
|
+
XTwitterScraper::SearchTweet::Article,
|
|
440
|
+
XTwitterScraper::Internal::AnyHash
|
|
441
|
+
)
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
sig { returns(T.nilable(String)) }
|
|
445
|
+
attr_reader :id
|
|
446
|
+
|
|
447
|
+
sig { params(id: String).void }
|
|
448
|
+
attr_writer :id
|
|
449
|
+
|
|
450
|
+
sig { returns(T.nilable(String)) }
|
|
451
|
+
attr_reader :cover_media_url
|
|
452
|
+
|
|
453
|
+
sig { params(cover_media_url: String).void }
|
|
454
|
+
attr_writer :cover_media_url
|
|
455
|
+
|
|
456
|
+
sig { returns(T.nilable(String)) }
|
|
457
|
+
attr_reader :preview_text
|
|
458
|
+
|
|
459
|
+
sig { params(preview_text: String).void }
|
|
460
|
+
attr_writer :preview_text
|
|
461
|
+
|
|
462
|
+
sig { returns(T.nilable(String)) }
|
|
463
|
+
attr_reader :title
|
|
464
|
+
|
|
465
|
+
sig { params(title: String).void }
|
|
466
|
+
attr_writer :title
|
|
467
|
+
|
|
468
|
+
# Article metadata attached to a tweet.
|
|
469
|
+
sig do
|
|
470
|
+
params(
|
|
471
|
+
id: String,
|
|
472
|
+
cover_media_url: String,
|
|
473
|
+
preview_text: String,
|
|
474
|
+
title: String
|
|
475
|
+
).returns(T.attached_class)
|
|
476
|
+
end
|
|
477
|
+
def self.new(
|
|
478
|
+
id: nil,
|
|
479
|
+
cover_media_url: nil,
|
|
480
|
+
preview_text: nil,
|
|
481
|
+
title: nil
|
|
482
|
+
)
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
sig do
|
|
486
|
+
override.returns(
|
|
487
|
+
{
|
|
488
|
+
id: String,
|
|
489
|
+
cover_media_url: String,
|
|
490
|
+
preview_text: String,
|
|
491
|
+
title: String
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
end
|
|
495
|
+
def to_hash
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
class Card < XTwitterScraper::Internal::Type::BaseModel
|
|
500
|
+
OrHash =
|
|
501
|
+
T.type_alias do
|
|
502
|
+
T.any(
|
|
503
|
+
XTwitterScraper::SearchTweet::Card,
|
|
504
|
+
XTwitterScraper::Internal::AnyHash
|
|
505
|
+
)
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
sig { returns(T.nilable(String)) }
|
|
509
|
+
attr_reader :id
|
|
510
|
+
|
|
511
|
+
sig { params(id: String).void }
|
|
512
|
+
attr_writer :id
|
|
513
|
+
|
|
514
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
515
|
+
attr_reader :binding_values
|
|
516
|
+
|
|
517
|
+
sig { params(binding_values: T::Hash[Symbol, T.anything]).void }
|
|
518
|
+
attr_writer :binding_values
|
|
519
|
+
|
|
520
|
+
sig { returns(T.nilable(String)) }
|
|
521
|
+
attr_reader :name
|
|
522
|
+
|
|
523
|
+
sig { params(name: String).void }
|
|
524
|
+
attr_writer :name
|
|
525
|
+
|
|
526
|
+
sig { returns(T.nilable(String)) }
|
|
527
|
+
attr_reader :url
|
|
528
|
+
|
|
529
|
+
sig { params(url: String).void }
|
|
530
|
+
attr_writer :url
|
|
531
|
+
|
|
532
|
+
# Public card metadata attached to a tweet.
|
|
533
|
+
sig do
|
|
534
|
+
params(
|
|
535
|
+
id: String,
|
|
536
|
+
binding_values: T::Hash[Symbol, T.anything],
|
|
537
|
+
name: String,
|
|
538
|
+
url: String
|
|
539
|
+
).returns(T.attached_class)
|
|
540
|
+
end
|
|
541
|
+
def self.new(id: nil, binding_values: nil, name: nil, url: nil)
|
|
542
|
+
end
|
|
543
|
+
|
|
544
|
+
sig do
|
|
545
|
+
override.returns(
|
|
546
|
+
{
|
|
547
|
+
id: String,
|
|
548
|
+
binding_values: T::Hash[Symbol, T.anything],
|
|
549
|
+
name: String,
|
|
550
|
+
url: String
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
end
|
|
554
|
+
def to_hash
|
|
555
|
+
end
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
class CommunityNote < XTwitterScraper::Internal::Type::BaseModel
|
|
559
|
+
OrHash =
|
|
560
|
+
T.type_alias do
|
|
561
|
+
T.any(
|
|
562
|
+
XTwitterScraper::SearchTweet::CommunityNote,
|
|
563
|
+
XTwitterScraper::Internal::AnyHash
|
|
564
|
+
)
|
|
565
|
+
end
|
|
566
|
+
|
|
567
|
+
sig { returns(T.nilable(String)) }
|
|
568
|
+
attr_reader :id
|
|
569
|
+
|
|
570
|
+
sig { params(id: String).void }
|
|
571
|
+
attr_writer :id
|
|
572
|
+
|
|
573
|
+
sig { returns(T.nilable(String)) }
|
|
574
|
+
attr_reader :destination_url
|
|
575
|
+
|
|
576
|
+
sig { params(destination_url: String).void }
|
|
577
|
+
attr_writer :destination_url
|
|
578
|
+
|
|
579
|
+
sig { returns(T.nilable(String)) }
|
|
580
|
+
attr_reader :footer
|
|
581
|
+
|
|
582
|
+
sig { params(footer: String).void }
|
|
583
|
+
attr_writer :footer
|
|
584
|
+
|
|
585
|
+
sig { returns(T.nilable(String)) }
|
|
586
|
+
attr_reader :short_title
|
|
587
|
+
|
|
588
|
+
sig { params(short_title: String).void }
|
|
589
|
+
attr_writer :short_title
|
|
590
|
+
|
|
591
|
+
sig { returns(T.nilable(String)) }
|
|
592
|
+
attr_reader :subtitle
|
|
593
|
+
|
|
594
|
+
sig { params(subtitle: String).void }
|
|
595
|
+
attr_writer :subtitle
|
|
596
|
+
|
|
597
|
+
sig { returns(T.nilable(String)) }
|
|
598
|
+
attr_reader :title
|
|
599
|
+
|
|
600
|
+
sig { params(title: String).void }
|
|
601
|
+
attr_writer :title
|
|
602
|
+
|
|
603
|
+
sig { returns(T.nilable(String)) }
|
|
604
|
+
attr_reader :visual_style
|
|
605
|
+
|
|
606
|
+
sig { params(visual_style: String).void }
|
|
607
|
+
attr_writer :visual_style
|
|
608
|
+
|
|
609
|
+
# Community Note presentation metadata returned by X.
|
|
610
|
+
sig do
|
|
611
|
+
params(
|
|
612
|
+
id: String,
|
|
613
|
+
destination_url: String,
|
|
614
|
+
footer: String,
|
|
615
|
+
short_title: String,
|
|
616
|
+
subtitle: String,
|
|
617
|
+
title: String,
|
|
618
|
+
visual_style: String
|
|
619
|
+
).returns(T.attached_class)
|
|
620
|
+
end
|
|
621
|
+
def self.new(
|
|
622
|
+
id: nil,
|
|
623
|
+
destination_url: nil,
|
|
624
|
+
footer: nil,
|
|
625
|
+
short_title: nil,
|
|
626
|
+
subtitle: nil,
|
|
627
|
+
title: nil,
|
|
628
|
+
visual_style: nil
|
|
629
|
+
)
|
|
630
|
+
end
|
|
631
|
+
|
|
632
|
+
sig do
|
|
633
|
+
override.returns(
|
|
634
|
+
{
|
|
635
|
+
id: String,
|
|
636
|
+
destination_url: String,
|
|
637
|
+
footer: String,
|
|
638
|
+
short_title: String,
|
|
639
|
+
subtitle: String,
|
|
640
|
+
title: String,
|
|
641
|
+
visual_style: String
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
end
|
|
645
|
+
def to_hash
|
|
646
|
+
end
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
class Edit < XTwitterScraper::Internal::Type::BaseModel
|
|
650
|
+
OrHash =
|
|
651
|
+
T.type_alias do
|
|
652
|
+
T.any(
|
|
653
|
+
XTwitterScraper::SearchTweet::Edit,
|
|
654
|
+
XTwitterScraper::Internal::AnyHash
|
|
655
|
+
)
|
|
656
|
+
end
|
|
657
|
+
|
|
658
|
+
sig { returns(T.nilable(String)) }
|
|
659
|
+
attr_reader :editable_until_msecs
|
|
660
|
+
|
|
661
|
+
sig { params(editable_until_msecs: String).void }
|
|
662
|
+
attr_writer :editable_until_msecs
|
|
663
|
+
|
|
664
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
665
|
+
attr_reader :edit_tweet_ids
|
|
666
|
+
|
|
667
|
+
sig { params(edit_tweet_ids: T::Array[String]).void }
|
|
668
|
+
attr_writer :edit_tweet_ids
|
|
669
|
+
|
|
670
|
+
# Edit history metadata returned by X.
|
|
671
|
+
sig do
|
|
672
|
+
params(
|
|
673
|
+
editable_until_msecs: String,
|
|
674
|
+
edit_tweet_ids: T::Array[String]
|
|
675
|
+
).returns(T.attached_class)
|
|
676
|
+
end
|
|
677
|
+
def self.new(editable_until_msecs: nil, edit_tweet_ids: nil)
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
sig do
|
|
681
|
+
override.returns(
|
|
682
|
+
{ editable_until_msecs: String, edit_tweet_ids: T::Array[String] }
|
|
683
|
+
)
|
|
684
|
+
end
|
|
685
|
+
def to_hash
|
|
686
|
+
end
|
|
687
|
+
end
|
|
688
|
+
|
|
689
|
+
class NoteTweet < XTwitterScraper::Internal::Type::BaseModel
|
|
690
|
+
OrHash =
|
|
691
|
+
T.type_alias do
|
|
692
|
+
T.any(
|
|
693
|
+
XTwitterScraper::SearchTweet::NoteTweet,
|
|
694
|
+
XTwitterScraper::Internal::AnyHash
|
|
695
|
+
)
|
|
696
|
+
end
|
|
697
|
+
|
|
698
|
+
sig { returns(String) }
|
|
699
|
+
attr_accessor :text
|
|
700
|
+
|
|
701
|
+
sig { returns(T.nilable(String)) }
|
|
702
|
+
attr_reader :id
|
|
703
|
+
|
|
704
|
+
sig { params(id: String).void }
|
|
705
|
+
attr_writer :id
|
|
706
|
+
|
|
707
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
708
|
+
attr_reader :entities
|
|
709
|
+
|
|
710
|
+
sig { params(entities: T::Hash[Symbol, T.anything]).void }
|
|
711
|
+
attr_writer :entities
|
|
712
|
+
|
|
713
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
714
|
+
attr_reader :is_expandable
|
|
715
|
+
|
|
716
|
+
sig { params(is_expandable: T::Boolean).void }
|
|
717
|
+
attr_writer :is_expandable
|
|
718
|
+
|
|
719
|
+
sig do
|
|
720
|
+
returns(
|
|
721
|
+
T.nilable(
|
|
722
|
+
T::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag]
|
|
723
|
+
)
|
|
724
|
+
)
|
|
725
|
+
end
|
|
726
|
+
attr_reader :richtext_tags
|
|
727
|
+
|
|
728
|
+
sig do
|
|
729
|
+
params(
|
|
730
|
+
richtext_tags:
|
|
731
|
+
T::Array[
|
|
732
|
+
XTwitterScraper::SearchTweet::NoteTweet::RichtextTag::OrHash
|
|
733
|
+
]
|
|
734
|
+
).void
|
|
735
|
+
end
|
|
736
|
+
attr_writer :richtext_tags
|
|
737
|
+
|
|
738
|
+
# Complete Note Tweet content and rich-text metadata.
|
|
739
|
+
sig do
|
|
740
|
+
params(
|
|
741
|
+
text: String,
|
|
742
|
+
id: String,
|
|
743
|
+
entities: T::Hash[Symbol, T.anything],
|
|
744
|
+
is_expandable: T::Boolean,
|
|
745
|
+
richtext_tags:
|
|
746
|
+
T::Array[
|
|
747
|
+
XTwitterScraper::SearchTweet::NoteTweet::RichtextTag::OrHash
|
|
748
|
+
]
|
|
749
|
+
).returns(T.attached_class)
|
|
750
|
+
end
|
|
751
|
+
def self.new(
|
|
752
|
+
text:,
|
|
753
|
+
id: nil,
|
|
754
|
+
entities: nil,
|
|
755
|
+
is_expandable: nil,
|
|
756
|
+
richtext_tags: nil
|
|
757
|
+
)
|
|
758
|
+
end
|
|
759
|
+
|
|
760
|
+
sig do
|
|
761
|
+
override.returns(
|
|
762
|
+
{
|
|
763
|
+
text: String,
|
|
764
|
+
id: String,
|
|
765
|
+
entities: T::Hash[Symbol, T.anything],
|
|
766
|
+
is_expandable: T::Boolean,
|
|
767
|
+
richtext_tags:
|
|
768
|
+
T::Array[XTwitterScraper::SearchTweet::NoteTweet::RichtextTag]
|
|
769
|
+
}
|
|
770
|
+
)
|
|
771
|
+
end
|
|
772
|
+
def to_hash
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
class RichtextTag < XTwitterScraper::Internal::Type::BaseModel
|
|
776
|
+
OrHash =
|
|
777
|
+
T.type_alias do
|
|
778
|
+
T.any(
|
|
779
|
+
XTwitterScraper::SearchTweet::NoteTweet::RichtextTag,
|
|
780
|
+
XTwitterScraper::Internal::AnyHash
|
|
781
|
+
)
|
|
782
|
+
end
|
|
783
|
+
|
|
784
|
+
sig { returns(Integer) }
|
|
785
|
+
attr_accessor :from_index
|
|
786
|
+
|
|
787
|
+
sig { returns(Integer) }
|
|
788
|
+
attr_accessor :to_index
|
|
789
|
+
|
|
790
|
+
sig { returns(T::Array[String]) }
|
|
791
|
+
attr_accessor :types
|
|
792
|
+
|
|
793
|
+
sig do
|
|
794
|
+
params(
|
|
795
|
+
from_index: Integer,
|
|
796
|
+
to_index: Integer,
|
|
797
|
+
types: T::Array[String]
|
|
798
|
+
).returns(T.attached_class)
|
|
799
|
+
end
|
|
800
|
+
def self.new(from_index:, to_index:, types:)
|
|
801
|
+
end
|
|
802
|
+
|
|
803
|
+
sig do
|
|
804
|
+
override.returns(
|
|
805
|
+
{
|
|
806
|
+
from_index: Integer,
|
|
807
|
+
to_index: Integer,
|
|
808
|
+
types: T::Array[String]
|
|
809
|
+
}
|
|
810
|
+
)
|
|
811
|
+
end
|
|
812
|
+
def to_hash
|
|
813
|
+
end
|
|
814
|
+
end
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
class Place < XTwitterScraper::Internal::Type::BaseModel
|
|
818
|
+
OrHash =
|
|
819
|
+
T.type_alias do
|
|
820
|
+
T.any(
|
|
821
|
+
XTwitterScraper::SearchTweet::Place,
|
|
822
|
+
XTwitterScraper::Internal::AnyHash
|
|
823
|
+
)
|
|
824
|
+
end
|
|
825
|
+
|
|
826
|
+
sig { returns(T.nilable(String)) }
|
|
827
|
+
attr_reader :id
|
|
828
|
+
|
|
829
|
+
sig { params(id: String).void }
|
|
830
|
+
attr_writer :id
|
|
831
|
+
|
|
832
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
833
|
+
attr_reader :bounding_box
|
|
834
|
+
|
|
835
|
+
sig { params(bounding_box: T::Hash[Symbol, T.anything]).void }
|
|
836
|
+
attr_writer :bounding_box
|
|
837
|
+
|
|
838
|
+
sig { returns(T.nilable(String)) }
|
|
839
|
+
attr_reader :country
|
|
840
|
+
|
|
841
|
+
sig { params(country: String).void }
|
|
842
|
+
attr_writer :country
|
|
843
|
+
|
|
844
|
+
sig { returns(T.nilable(String)) }
|
|
845
|
+
attr_reader :country_code
|
|
846
|
+
|
|
847
|
+
sig { params(country_code: String).void }
|
|
848
|
+
attr_writer :country_code
|
|
849
|
+
|
|
850
|
+
sig { returns(T.nilable(String)) }
|
|
851
|
+
attr_reader :full_name
|
|
852
|
+
|
|
853
|
+
sig { params(full_name: String).void }
|
|
854
|
+
attr_writer :full_name
|
|
855
|
+
|
|
856
|
+
sig { returns(T.nilable(String)) }
|
|
857
|
+
attr_reader :name
|
|
858
|
+
|
|
859
|
+
sig { params(name: String).void }
|
|
860
|
+
attr_writer :name
|
|
861
|
+
|
|
862
|
+
sig { returns(T.nilable(String)) }
|
|
863
|
+
attr_reader :place_type
|
|
864
|
+
|
|
865
|
+
sig { params(place_type: String).void }
|
|
866
|
+
attr_writer :place_type
|
|
867
|
+
|
|
868
|
+
sig { returns(T.nilable(String)) }
|
|
869
|
+
attr_reader :url
|
|
870
|
+
|
|
871
|
+
sig { params(url: String).void }
|
|
872
|
+
attr_writer :url
|
|
873
|
+
|
|
874
|
+
# Public place metadata attached to a tweet.
|
|
875
|
+
sig do
|
|
876
|
+
params(
|
|
877
|
+
id: String,
|
|
878
|
+
bounding_box: T::Hash[Symbol, T.anything],
|
|
879
|
+
country: String,
|
|
880
|
+
country_code: String,
|
|
881
|
+
full_name: String,
|
|
882
|
+
name: String,
|
|
883
|
+
place_type: String,
|
|
884
|
+
url: String
|
|
885
|
+
).returns(T.attached_class)
|
|
886
|
+
end
|
|
887
|
+
def self.new(
|
|
888
|
+
id: nil,
|
|
889
|
+
bounding_box: nil,
|
|
890
|
+
country: nil,
|
|
891
|
+
country_code: nil,
|
|
892
|
+
full_name: nil,
|
|
893
|
+
name: nil,
|
|
894
|
+
place_type: nil,
|
|
895
|
+
url: nil
|
|
896
|
+
)
|
|
897
|
+
end
|
|
898
|
+
|
|
899
|
+
sig do
|
|
900
|
+
override.returns(
|
|
901
|
+
{
|
|
902
|
+
id: String,
|
|
903
|
+
bounding_box: T::Hash[Symbol, T.anything],
|
|
904
|
+
country: String,
|
|
905
|
+
country_code: String,
|
|
906
|
+
full_name: String,
|
|
907
|
+
name: String,
|
|
908
|
+
place_type: String,
|
|
909
|
+
url: String
|
|
910
|
+
}
|
|
911
|
+
)
|
|
912
|
+
end
|
|
913
|
+
def to_hash
|
|
914
|
+
end
|
|
915
|
+
end
|
|
916
|
+
|
|
917
|
+
class PreviousCounts < XTwitterScraper::Internal::Type::BaseModel
|
|
918
|
+
OrHash =
|
|
919
|
+
T.type_alias do
|
|
920
|
+
T.any(
|
|
921
|
+
XTwitterScraper::SearchTweet::PreviousCounts,
|
|
922
|
+
XTwitterScraper::Internal::AnyHash
|
|
923
|
+
)
|
|
924
|
+
end
|
|
925
|
+
|
|
926
|
+
sig { returns(T.nilable(Integer)) }
|
|
927
|
+
attr_reader :bookmark_count
|
|
928
|
+
|
|
929
|
+
sig { params(bookmark_count: Integer).void }
|
|
930
|
+
attr_writer :bookmark_count
|
|
931
|
+
|
|
932
|
+
sig { returns(T.nilable(Integer)) }
|
|
933
|
+
attr_reader :like_count
|
|
934
|
+
|
|
935
|
+
sig { params(like_count: Integer).void }
|
|
936
|
+
attr_writer :like_count
|
|
937
|
+
|
|
938
|
+
sig { returns(T.nilable(Integer)) }
|
|
939
|
+
attr_reader :quote_count
|
|
940
|
+
|
|
941
|
+
sig { params(quote_count: Integer).void }
|
|
942
|
+
attr_writer :quote_count
|
|
943
|
+
|
|
944
|
+
sig { returns(T.nilable(Integer)) }
|
|
945
|
+
attr_reader :reply_count
|
|
946
|
+
|
|
947
|
+
sig { params(reply_count: Integer).void }
|
|
948
|
+
attr_writer :reply_count
|
|
949
|
+
|
|
950
|
+
sig { returns(T.nilable(Integer)) }
|
|
951
|
+
attr_reader :retweet_count
|
|
952
|
+
|
|
953
|
+
sig { params(retweet_count: Integer).void }
|
|
954
|
+
attr_writer :retweet_count
|
|
955
|
+
|
|
956
|
+
# Engagement counts retained from a prior tweet edit.
|
|
957
|
+
sig do
|
|
958
|
+
params(
|
|
959
|
+
bookmark_count: Integer,
|
|
960
|
+
like_count: Integer,
|
|
961
|
+
quote_count: Integer,
|
|
962
|
+
reply_count: Integer,
|
|
963
|
+
retweet_count: Integer
|
|
964
|
+
).returns(T.attached_class)
|
|
965
|
+
end
|
|
966
|
+
def self.new(
|
|
967
|
+
bookmark_count: nil,
|
|
968
|
+
like_count: nil,
|
|
969
|
+
quote_count: nil,
|
|
970
|
+
reply_count: nil,
|
|
971
|
+
retweet_count: nil
|
|
972
|
+
)
|
|
973
|
+
end
|
|
974
|
+
|
|
975
|
+
sig do
|
|
976
|
+
override.returns(
|
|
977
|
+
{
|
|
978
|
+
bookmark_count: Integer,
|
|
979
|
+
like_count: Integer,
|
|
980
|
+
quote_count: Integer,
|
|
981
|
+
reply_count: Integer,
|
|
982
|
+
retweet_count: Integer
|
|
983
|
+
}
|
|
984
|
+
)
|
|
985
|
+
end
|
|
986
|
+
def to_hash
|
|
987
|
+
end
|
|
988
|
+
end
|
|
318
989
|
end
|
|
319
990
|
end
|
|
320
991
|
end
|