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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/README.md +1 -1
- data/lib/x_twitter_scraper/internal/type/union.rb +25 -9
- data/lib/x_twitter_scraper/models/compose_create_response.rb +62 -1
- 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/radar_item.rb +144 -7
- 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_params.rb +22 -0
- data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +224 -0
- data/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +4 -4
- data/lib/x_twitter_scraper/models/x/account_create_params.rb +9 -9
- data/lib/x_twitter_scraper/models/x/account_create_response.rb +146 -54
- data/lib/x_twitter_scraper/models/x/account_reauth_params.rb +2 -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/x_account.rb +9 -9
- 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/compose.rb +4 -4
- data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +37 -0
- data/lib/x_twitter_scraper/resources/x/accounts.rb +5 -5
- 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/resources/x.rb +6 -0
- data/lib/x_twitter_scraper/version.rb +1 -1
- data/lib/x_twitter_scraper.rb +5 -1
- data/rbi/x_twitter_scraper/models/compose_create_response.rbi +142 -0
- 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/radar_item.rbi +245 -8
- 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_params.rbi +40 -0
- data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +295 -0
- data/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +6 -6
- data/rbi/x_twitter_scraper/models/x/account_create_params.rbi +8 -11
- data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +232 -91
- data/rbi/x_twitter_scraper/models/x/account_reauth_params.rbi +2 -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/x_account.rbi +12 -12
- 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/compose.rbi +4 -4
- data/rbi/x_twitter_scraper/resources/x/account_connection_attempts.rbi +33 -0
- data/rbi/x_twitter_scraper/resources/x/accounts.rbi +5 -5
- 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/rbi/x_twitter_scraper/resources/x.rbi +4 -0
- data/sig/x_twitter_scraper/models/compose_create_response.rbs +60 -0
- 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/radar_item.rbs +100 -4
- 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_params.rbs +25 -0
- data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +199 -0
- data/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +5 -5
- data/sig/x_twitter_scraper/models/x/account_create_params.rbs +6 -8
- data/sig/x_twitter_scraper/models/x/account_create_response.rbs +144 -59
- 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/account_connection_attempts.rbs +14 -0
- data/sig/x_twitter_scraper/resources/x/accounts.rbs +2 -2
- data/sig/x_twitter_scraper/resources/x/tweets.rbs +3 -1
- data/sig/x_twitter_scraper/resources/x.rbs +2 -0
- metadata +14 -2
|
@@ -24,11 +24,10 @@ module XTwitterScraper
|
|
|
24
24
|
sig { returns(T::Array[XTwitterScraper::SearchTweet]) }
|
|
25
25
|
attr_accessor :tweets
|
|
26
26
|
|
|
27
|
-
# Paginated
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
# 402 insufficient_credits.
|
|
27
|
+
# Paginated tweets. Source visibility, filters, or remaining credits can reduce
|
|
28
|
+
# results. An empty filtered page can still have has_next_page true. Follow
|
|
29
|
+
# next_cursor while has_next_page is true. Zero affordable results returns 402
|
|
30
|
+
# insufficient_credits.
|
|
32
31
|
sig do
|
|
33
32
|
params(
|
|
34
33
|
has_next_page: T::Boolean,
|
|
@@ -22,12 +22,24 @@ module XTwitterScraper
|
|
|
22
22
|
sig { returns(Time) }
|
|
23
23
|
attr_accessor :created_at
|
|
24
24
|
|
|
25
|
+
# BCP-47 language code. und means the source did not identify a language.
|
|
25
26
|
sig { returns(String) }
|
|
26
27
|
attr_accessor :language
|
|
27
28
|
|
|
28
29
|
# Source-specific fields. Shape varies per source:
|
|
29
30
|
#
|
|
30
|
-
# - reddit: { subreddit
|
|
31
|
+
# - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
|
|
32
|
+
# sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
|
|
33
|
+
# numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
|
|
34
|
+
# postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
|
|
35
|
+
# editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
|
|
36
|
+
# isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
|
|
37
|
+
# isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
|
|
38
|
+
# public net score. Exact public upvote and downvote counts are not available.
|
|
39
|
+
# Estimated counts derive from the public score and upvote ratio, which Reddit
|
|
40
|
+
# may fuzz. Comment bodies are not included. Current items combine public
|
|
41
|
+
# listing discovery with server-rendered post data and use `sourceFormat: html`;
|
|
42
|
+
# `json` and `rss` remain for legacy rows.
|
|
31
43
|
# - github: { starsToday: number }
|
|
32
44
|
# - hacker_news: { points: number, numberComments: number }
|
|
33
45
|
# - google_trends: { approxTraffic: number }
|
|
@@ -35,9 +47,19 @@ module XTwitterScraper
|
|
|
35
47
|
# - wikipedia: { views: number }
|
|
36
48
|
# - trustmrr: { mrr, growthPercent, last30Days, total, customers,
|
|
37
49
|
# activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
# foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
|
|
51
|
+
# multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
|
|
52
|
+
# revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
|
|
53
|
+
# growth source, xHandle is the founder's X username without @. The rank field
|
|
54
|
+
# is the source's revenue rank. Result order represents reported 30-day
|
|
55
|
+
# revenue-growth rank.
|
|
56
|
+
sig { returns(XTwitterScraper::RadarItem::Metadata) }
|
|
57
|
+
attr_reader :metadata
|
|
58
|
+
|
|
59
|
+
sig do
|
|
60
|
+
params(metadata: XTwitterScraper::RadarItem::Metadata::OrHash).void
|
|
61
|
+
end
|
|
62
|
+
attr_writer :metadata
|
|
41
63
|
|
|
42
64
|
sig { returns(Time) }
|
|
43
65
|
attr_accessor :published_at
|
|
@@ -64,6 +86,7 @@ module XTwitterScraper
|
|
|
64
86
|
sig { params(description: String).void }
|
|
65
87
|
attr_writer :description
|
|
66
88
|
|
|
89
|
+
# Source image. Startup growth items return the logo here.
|
|
67
90
|
sig { returns(T.nilable(String)) }
|
|
68
91
|
attr_reader :image_url
|
|
69
92
|
|
|
@@ -84,7 +107,7 @@ module XTwitterScraper
|
|
|
84
107
|
category: XTwitterScraper::RadarItem::Category::OrSymbol,
|
|
85
108
|
created_at: Time,
|
|
86
109
|
language: String,
|
|
87
|
-
metadata:
|
|
110
|
+
metadata: XTwitterScraper::RadarItem::Metadata::OrHash,
|
|
88
111
|
published_at: Time,
|
|
89
112
|
region: String,
|
|
90
113
|
score: Float,
|
|
@@ -101,10 +124,22 @@ module XTwitterScraper
|
|
|
101
124
|
id:,
|
|
102
125
|
category:,
|
|
103
126
|
created_at:,
|
|
127
|
+
# BCP-47 language code. und means the source did not identify a language.
|
|
104
128
|
language:,
|
|
105
129
|
# Source-specific fields. Shape varies per source:
|
|
106
130
|
#
|
|
107
|
-
# - reddit: { subreddit
|
|
131
|
+
# - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
|
|
132
|
+
# sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
|
|
133
|
+
# numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
|
|
134
|
+
# postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
|
|
135
|
+
# editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
|
|
136
|
+
# isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
|
|
137
|
+
# isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
|
|
138
|
+
# public net score. Exact public upvote and downvote counts are not available.
|
|
139
|
+
# Estimated counts derive from the public score and upvote ratio, which Reddit
|
|
140
|
+
# may fuzz. Comment bodies are not included. Current items combine public
|
|
141
|
+
# listing discovery with server-rendered post data and use `sourceFormat: html`;
|
|
142
|
+
# `json` and `rss` remain for legacy rows.
|
|
108
143
|
# - github: { starsToday: number }
|
|
109
144
|
# - hacker_news: { points: number, numberComments: number }
|
|
110
145
|
# - google_trends: { approxTraffic: number }
|
|
@@ -112,7 +147,12 @@ module XTwitterScraper
|
|
|
112
147
|
# - wikipedia: { views: number }
|
|
113
148
|
# - trustmrr: { mrr, growthPercent, last30Days, total, customers,
|
|
114
149
|
# activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
|
|
115
|
-
#
|
|
150
|
+
# foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
|
|
151
|
+
# multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
|
|
152
|
+
# revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
|
|
153
|
+
# growth source, xHandle is the founder's X username without @. The rank field
|
|
154
|
+
# is the source's revenue rank. Result order represents reported 30-day
|
|
155
|
+
# revenue-growth rank.
|
|
116
156
|
metadata:,
|
|
117
157
|
published_at:,
|
|
118
158
|
region:,
|
|
@@ -122,6 +162,7 @@ module XTwitterScraper
|
|
|
122
162
|
source_id:,
|
|
123
163
|
title:,
|
|
124
164
|
description: nil,
|
|
165
|
+
# Source image. Startup growth items return the logo here.
|
|
125
166
|
image_url: nil,
|
|
126
167
|
url: nil
|
|
127
168
|
)
|
|
@@ -134,7 +175,7 @@ module XTwitterScraper
|
|
|
134
175
|
category: XTwitterScraper::RadarItem::Category::TaggedSymbol,
|
|
135
176
|
created_at: Time,
|
|
136
177
|
language: String,
|
|
137
|
-
metadata:
|
|
178
|
+
metadata: XTwitterScraper::RadarItem::Metadata,
|
|
138
179
|
published_at: Time,
|
|
139
180
|
region: String,
|
|
140
181
|
score: Float,
|
|
@@ -184,6 +225,202 @@ module XTwitterScraper
|
|
|
184
225
|
end
|
|
185
226
|
end
|
|
186
227
|
|
|
228
|
+
class Metadata < XTwitterScraper::Internal::Type::BaseModel
|
|
229
|
+
OrHash =
|
|
230
|
+
T.type_alias do
|
|
231
|
+
T.any(
|
|
232
|
+
XTwitterScraper::RadarItem::Metadata,
|
|
233
|
+
XTwitterScraper::Internal::AnyHash
|
|
234
|
+
)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
sig { returns(T.nilable(String)) }
|
|
238
|
+
attr_reader :author
|
|
239
|
+
|
|
240
|
+
sig { params(author: String).void }
|
|
241
|
+
attr_writer :author
|
|
242
|
+
|
|
243
|
+
sig { returns(T.nilable(String)) }
|
|
244
|
+
attr_reader :content_url
|
|
245
|
+
|
|
246
|
+
sig { params(content_url: String).void }
|
|
247
|
+
attr_writer :content_url
|
|
248
|
+
|
|
249
|
+
sig { returns(T.nilable(Integer)) }
|
|
250
|
+
attr_reader :estimated_downvotes
|
|
251
|
+
|
|
252
|
+
sig { params(estimated_downvotes: Integer).void }
|
|
253
|
+
attr_writer :estimated_downvotes
|
|
254
|
+
|
|
255
|
+
sig { returns(T.nilable(Integer)) }
|
|
256
|
+
attr_reader :estimated_upvotes
|
|
257
|
+
|
|
258
|
+
sig { params(estimated_upvotes: Integer).void }
|
|
259
|
+
attr_writer :estimated_upvotes
|
|
260
|
+
|
|
261
|
+
sig { returns(T.nilable(Integer)) }
|
|
262
|
+
attr_reader :number_comments
|
|
263
|
+
|
|
264
|
+
sig { params(number_comments: Integer).void }
|
|
265
|
+
attr_writer :number_comments
|
|
266
|
+
|
|
267
|
+
sig { returns(T.nilable(Integer)) }
|
|
268
|
+
attr_reader :score
|
|
269
|
+
|
|
270
|
+
sig { params(score: Integer).void }
|
|
271
|
+
attr_writer :score
|
|
272
|
+
|
|
273
|
+
sig { returns(T.nilable(String)) }
|
|
274
|
+
attr_reader :selftext
|
|
275
|
+
|
|
276
|
+
sig { params(selftext: String).void }
|
|
277
|
+
attr_writer :selftext
|
|
278
|
+
|
|
279
|
+
# Current items use html. json and rss are retained for legacy rows.
|
|
280
|
+
sig do
|
|
281
|
+
returns(
|
|
282
|
+
T.nilable(
|
|
283
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::TaggedSymbol
|
|
284
|
+
)
|
|
285
|
+
)
|
|
286
|
+
end
|
|
287
|
+
attr_reader :source_format
|
|
288
|
+
|
|
289
|
+
sig do
|
|
290
|
+
params(
|
|
291
|
+
source_format:
|
|
292
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::OrSymbol
|
|
293
|
+
).void
|
|
294
|
+
end
|
|
295
|
+
attr_writer :source_format
|
|
296
|
+
|
|
297
|
+
sig { returns(T.nilable(String)) }
|
|
298
|
+
attr_reader :subreddit
|
|
299
|
+
|
|
300
|
+
sig { params(subreddit: String).void }
|
|
301
|
+
attr_writer :subreddit
|
|
302
|
+
|
|
303
|
+
sig { returns(T.nilable(Float)) }
|
|
304
|
+
attr_reader :upvote_ratio
|
|
305
|
+
|
|
306
|
+
sig { params(upvote_ratio: Float).void }
|
|
307
|
+
attr_writer :upvote_ratio
|
|
308
|
+
|
|
309
|
+
# Source-specific fields. Shape varies per source:
|
|
310
|
+
#
|
|
311
|
+
# - reddit: { author, authorId?, subreddit, subredditId?, subredditSubscribers?,
|
|
312
|
+
# sourceFormat, score?, upvoteRatio?, estimatedUpvotes?, estimatedDownvotes?,
|
|
313
|
+
# numberComments?, numberCrossposts?, selftext?, contentUrl?, domain?,
|
|
314
|
+
# postHint?, linkFlairText?, distinguished?, totalAwardsReceived?, viewCount?,
|
|
315
|
+
# editedAt?, galleryImageUrls?, redditVideo?, archived?, contestMode?,
|
|
316
|
+
# isCrosspostable?, isMeta?, isNsfw?, isOriginalContent?, isRobotIndexable?,
|
|
317
|
+
# isSelf?, isSpoiler?, isVideo?, locked?, stickied? }. `score` is Reddit's
|
|
318
|
+
# public net score. Exact public upvote and downvote counts are not available.
|
|
319
|
+
# Estimated counts derive from the public score and upvote ratio, which Reddit
|
|
320
|
+
# may fuzz. Comment bodies are not included. Current items combine public
|
|
321
|
+
# listing discovery with server-rendered post data and use `sourceFormat: html`;
|
|
322
|
+
# `json` and `rss` remain for legacy rows.
|
|
323
|
+
# - github: { starsToday: number }
|
|
324
|
+
# - hacker_news: { points: number, numberComments: number }
|
|
325
|
+
# - google_trends: { approxTraffic: number }
|
|
326
|
+
# - polymarket: { volume24hr: number }
|
|
327
|
+
# - wikipedia: { views: number }
|
|
328
|
+
# - trustmrr: { mrr, growthPercent, last30Days, total, customers,
|
|
329
|
+
# activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
|
|
330
|
+
# foundedDate?, googleSearchImpressionsLast30Days?, growthMrrPercent?,
|
|
331
|
+
# multiple?, paymentProvider?, profitMarginLast30Days?, rank?,
|
|
332
|
+
# revenuePerVisitor?, targetAudience?, visitorsLast30Days? } For the startup
|
|
333
|
+
# growth source, xHandle is the founder's X username without @. The rank field
|
|
334
|
+
# is the source's revenue rank. Result order represents reported 30-day
|
|
335
|
+
# revenue-growth rank.
|
|
336
|
+
sig do
|
|
337
|
+
params(
|
|
338
|
+
author: String,
|
|
339
|
+
content_url: String,
|
|
340
|
+
estimated_downvotes: Integer,
|
|
341
|
+
estimated_upvotes: Integer,
|
|
342
|
+
number_comments: Integer,
|
|
343
|
+
score: Integer,
|
|
344
|
+
selftext: String,
|
|
345
|
+
source_format:
|
|
346
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::OrSymbol,
|
|
347
|
+
subreddit: String,
|
|
348
|
+
upvote_ratio: Float
|
|
349
|
+
).returns(T.attached_class)
|
|
350
|
+
end
|
|
351
|
+
def self.new(
|
|
352
|
+
author: nil,
|
|
353
|
+
content_url: nil,
|
|
354
|
+
estimated_downvotes: nil,
|
|
355
|
+
estimated_upvotes: nil,
|
|
356
|
+
number_comments: nil,
|
|
357
|
+
score: nil,
|
|
358
|
+
selftext: nil,
|
|
359
|
+
# Current items use html. json and rss are retained for legacy rows.
|
|
360
|
+
source_format: nil,
|
|
361
|
+
subreddit: nil,
|
|
362
|
+
upvote_ratio: nil
|
|
363
|
+
)
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
sig do
|
|
367
|
+
override.returns(
|
|
368
|
+
{
|
|
369
|
+
author: String,
|
|
370
|
+
content_url: String,
|
|
371
|
+
estimated_downvotes: Integer,
|
|
372
|
+
estimated_upvotes: Integer,
|
|
373
|
+
number_comments: Integer,
|
|
374
|
+
score: Integer,
|
|
375
|
+
selftext: String,
|
|
376
|
+
source_format:
|
|
377
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::TaggedSymbol,
|
|
378
|
+
subreddit: String,
|
|
379
|
+
upvote_ratio: Float
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
end
|
|
383
|
+
def to_hash
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
# Current items use html. json and rss are retained for legacy rows.
|
|
387
|
+
module SourceFormat
|
|
388
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
389
|
+
|
|
390
|
+
TaggedSymbol =
|
|
391
|
+
T.type_alias do
|
|
392
|
+
T.all(Symbol, XTwitterScraper::RadarItem::Metadata::SourceFormat)
|
|
393
|
+
end
|
|
394
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
395
|
+
|
|
396
|
+
HTML =
|
|
397
|
+
T.let(
|
|
398
|
+
:html,
|
|
399
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::TaggedSymbol
|
|
400
|
+
)
|
|
401
|
+
JSON =
|
|
402
|
+
T.let(
|
|
403
|
+
:json,
|
|
404
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::TaggedSymbol
|
|
405
|
+
)
|
|
406
|
+
RSS =
|
|
407
|
+
T.let(
|
|
408
|
+
:rss,
|
|
409
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::TaggedSymbol
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
sig do
|
|
413
|
+
override.returns(
|
|
414
|
+
T::Array[
|
|
415
|
+
XTwitterScraper::RadarItem::Metadata::SourceFormat::TaggedSymbol
|
|
416
|
+
]
|
|
417
|
+
)
|
|
418
|
+
end
|
|
419
|
+
def self.values
|
|
420
|
+
end
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
|
|
187
424
|
module Source
|
|
188
425
|
extend XTwitterScraper::Internal::Type::Enum
|
|
189
426
|
|