x-twitter-scraper 0.4.5 → 0.5.2
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 +33 -0
- data/README.md +8 -41
- data/lib/x_twitter_scraper/client.rb +1 -1
- data/lib/x_twitter_scraper/internal/type/union.rb +13 -0
- data/lib/x_twitter_scraper/models/account_retrieve_response.rb +4 -4
- data/lib/x_twitter_scraper/models/compose_create_params.rb +194 -122
- data/lib/x_twitter_scraper/models/compose_create_response.rb +326 -33
- data/lib/x_twitter_scraper/models/credit_retrieve_topup_status_params.rb +2 -2
- data/lib/x_twitter_scraper/models/error.rb +99 -3
- data/lib/x_twitter_scraper/models/extraction_estimate_cost_params.rb +8 -8
- data/lib/x_twitter_scraper/models/guest_wallet_create_params.rb +2 -2
- data/lib/x_twitter_scraper/models/guest_wallet_create_response.rb +27 -7
- data/lib/x_twitter_scraper/models/guest_wallet_topup_params.rb +2 -2
- data/lib/x_twitter_scraper/models/guest_wallet_topup_response.rb +27 -7
- data/lib/x_twitter_scraper/models/search_tweet.rb +12 -12
- data/lib/x_twitter_scraper/models/support/ticket_create_params.rb +7 -1
- data/lib/x_twitter_scraper/models/support/ticket_create_response.rb +40 -3
- data/lib/x_twitter_scraper/models/support/ticket_reply_params.rb +7 -1
- data/lib/x_twitter_scraper/models/support/ticket_reply_response.rb +40 -3
- data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +114 -1
- data/lib/x_twitter_scraper/models/x/communities/join_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/communities/join_create_response.rb +577 -4
- data/lib/x_twitter_scraper/models/x/communities/join_delete_all_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/communities/join_delete_all_response.rb +585 -4
- data/lib/x_twitter_scraper/models/x/community_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/community_create_response.rb +568 -8
- data/lib/x_twitter_scraper/models/x/community_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/community_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/dm_send_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/dm_send_response.rb +573 -7
- data/lib/x_twitter_scraper/models/x/media_upload_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/media_upload_response.rb +568 -11
- data/lib/x_twitter_scraper/models/x/profile_update_avatar_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/profile_update_avatar_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/profile_update_banner_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/profile_update_banner_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/profile_update_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/profile_update_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweet_author.rb +1 -14
- data/lib/x_twitter_scraper/models/x/tweet_create_params.rb +5 -5
- data/lib/x_twitter_scraper/models/x/tweet_create_response.rb +551 -12
- data/lib/x_twitter_scraper/models/x/tweet_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweet_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/like_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/like_create_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/like_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/like_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/retweet_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/retweet_create_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/tweets/retweet_delete_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/tweets/retweet_delete_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/user_remove_follower_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/user_remove_follower_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/user_retrieve_following_params.rb +2 -2
- data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +2 -2
- data/lib/x_twitter_scraper/models/x/users/follow_create_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/users/follow_create_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/users/follow_delete_all_params.rb +8 -1
- data/lib/x_twitter_scraper/models/x/users/follow_delete_all_response.rb +576 -4
- data/lib/x_twitter_scraper/models/x/write_action_retrieve_response.rb +469 -52
- data/lib/x_twitter_scraper/models/x/x_account.rb +7 -7
- data/lib/x_twitter_scraper/models/x/x_account_detail.rb +1 -1
- data/lib/x_twitter_scraper/resources/compose.rb +8 -26
- data/lib/x_twitter_scraper/resources/credits.rb +1 -1
- data/lib/x_twitter_scraper/resources/extractions.rb +4 -4
- data/lib/x_twitter_scraper/resources/guest_wallets.rb +2 -2
- data/lib/x_twitter_scraper/resources/monitors/keywords.rb +4 -5
- data/lib/x_twitter_scraper/resources/monitors.rb +3 -3
- data/lib/x_twitter_scraper/resources/support/tickets.rb +24 -8
- data/lib/x_twitter_scraper/resources/trends.rb +1 -1
- data/lib/x_twitter_scraper/resources/x/communities/join.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/communities.rb +25 -11
- data/lib/x_twitter_scraper/resources/x/dm.rb +13 -6
- data/lib/x_twitter_scraper/resources/x/media.rb +17 -7
- data/lib/x_twitter_scraper/resources/x/profile.rb +46 -17
- data/lib/x_twitter_scraper/resources/x/tweets/like.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/tweets/retweet.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/tweets.rb +31 -16
- data/lib/x_twitter_scraper/resources/x/users/follow.rb +22 -8
- data/lib/x_twitter_scraper/resources/x/users.rb +16 -9
- data/lib/x_twitter_scraper/resources/x.rb +1 -2
- data/lib/x_twitter_scraper/version.rb +1 -1
- data/rbi/x_twitter_scraper/client.rbi +1 -1
- data/rbi/x_twitter_scraper/models/account_retrieve_response.rbi +4 -4
- data/rbi/x_twitter_scraper/models/compose_create_params.rbi +392 -215
- data/rbi/x_twitter_scraper/models/compose_create_response.rbi +537 -48
- data/rbi/x_twitter_scraper/models/credit_retrieve_topup_status_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/error.rbi +379 -13
- data/rbi/x_twitter_scraper/models/extraction_estimate_cost_params.rbi +8 -8
- data/rbi/x_twitter_scraper/models/guest_wallet_create_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/guest_wallet_create_response.rbi +87 -5
- data/rbi/x_twitter_scraper/models/guest_wallet_topup_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/guest_wallet_topup_response.rbi +87 -5
- data/rbi/x_twitter_scraper/models/search_tweet.rbi +12 -12
- data/rbi/x_twitter_scraper/models/support/ticket_create_params.rbi +9 -1
- data/rbi/x_twitter_scraper/models/support/ticket_create_response.rbi +113 -7
- data/rbi/x_twitter_scraper/models/support/ticket_reply_params.rbi +9 -1
- data/rbi/x_twitter_scraper/models/support/ticket_reply_response.rbi +113 -7
- data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +276 -5
- data/rbi/x_twitter_scraper/models/x/communities/join_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/communities/join_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/communities/join_delete_all_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/communities/join_delete_all_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/community_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/community_create_response.rbi +1127 -5
- data/rbi/x_twitter_scraper/models/x/community_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/community_delete_response.rbi +1148 -3
- data/rbi/x_twitter_scraper/models/x/dm_send_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/dm_send_response.rbi +1112 -6
- data/rbi/x_twitter_scraper/models/x/media_upload_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/media_upload_response.rbi +1124 -9
- data/rbi/x_twitter_scraper/models/x/profile_update_avatar_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/profile_update_avatar_response.rbi +1152 -3
- data/rbi/x_twitter_scraper/models/x/profile_update_banner_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/profile_update_banner_response.rbi +1152 -3
- data/rbi/x_twitter_scraper/models/x/profile_update_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/profile_update_response.rbi +1144 -3
- data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +3 -13
- data/rbi/x_twitter_scraper/models/x/tweet_create_params.rbi +5 -8
- data/rbi/x_twitter_scraper/models/x/tweet_create_response.rbi +1108 -14
- data/rbi/x_twitter_scraper/models/x/tweet_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweet_delete_response.rbi +1140 -3
- data/rbi/x_twitter_scraper/models/x/tweets/like_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/like_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/tweets/like_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/like_delete_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/user_remove_follower_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/user_remove_follower_response.rbi +1152 -3
- data/rbi/x_twitter_scraper/models/x/user_retrieve_following_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +2 -2
- data/rbi/x_twitter_scraper/models/x/users/follow_create_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/users/follow_create_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/users/follow_delete_all_params.rbi +6 -0
- data/rbi/x_twitter_scraper/models/x/users/follow_delete_all_response.rbi +1154 -3
- data/rbi/x_twitter_scraper/models/x/write_action_retrieve_response.rbi +930 -66
- data/rbi/x_twitter_scraper/models/x/x_account.rbi +9 -9
- data/rbi/x_twitter_scraper/models/x/x_account_detail.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/compose.rbi +12 -38
- data/rbi/x_twitter_scraper/resources/credits.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/extractions.rbi +4 -4
- data/rbi/x_twitter_scraper/resources/guest_wallets.rbi +2 -2
- data/rbi/x_twitter_scraper/resources/monitors/keywords.rbi +4 -5
- data/rbi/x_twitter_scraper/resources/monitors.rbi +3 -3
- data/rbi/x_twitter_scraper/resources/support/tickets.rbi +17 -2
- data/rbi/x_twitter_scraper/resources/trends.rbi +1 -1
- data/rbi/x_twitter_scraper/resources/x/communities/join.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/communities.rbi +19 -7
- data/rbi/x_twitter_scraper/resources/x/dm.rbi +10 -3
- data/rbi/x_twitter_scraper/resources/x/media.rbi +9 -4
- data/rbi/x_twitter_scraper/resources/x/profile.rbi +27 -8
- data/rbi/x_twitter_scraper/resources/x/tweets/like.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/tweets/retweet.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/tweets.rbi +31 -12
- data/rbi/x_twitter_scraper/resources/x/users/follow.rbi +16 -4
- data/rbi/x_twitter_scraper/resources/x/users.rbi +13 -7
- data/rbi/x_twitter_scraper/resources/x.rbi +1 -2
- data/sig/x_twitter_scraper/models/compose_create_params.rbs +150 -90
- data/sig/x_twitter_scraper/models/compose_create_response.rbs +249 -27
- data/sig/x_twitter_scraper/models/error.rbs +170 -7
- data/sig/x_twitter_scraper/models/guest_wallet_create_response.rbs +35 -5
- data/sig/x_twitter_scraper/models/guest_wallet_topup_response.rbs +35 -5
- data/sig/x_twitter_scraper/models/support/ticket_create_params.rbs +7 -1
- data/sig/x_twitter_scraper/models/support/ticket_create_response.rbs +49 -5
- data/sig/x_twitter_scraper/models/support/ticket_reply_params.rbs +7 -1
- data/sig/x_twitter_scraper/models/support/ticket_reply_response.rbs +49 -5
- data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +113 -2
- data/sig/x_twitter_scraper/models/x/communities/join_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/communities/join_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/communities/join_delete_all_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/communities/join_delete_all_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/community_create_params.rbs +10 -1
- data/sig/x_twitter_scraper/models/x/community_create_response.rbs +528 -7
- data/sig/x_twitter_scraper/models/x/community_delete_params.rbs +10 -1
- data/sig/x_twitter_scraper/models/x/community_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/dm_send_params.rbs +5 -0
- data/sig/x_twitter_scraper/models/x/dm_send_response.rbs +539 -5
- data/sig/x_twitter_scraper/models/x/media_upload_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/media_upload_response.rbs +534 -7
- data/sig/x_twitter_scraper/models/x/profile_update_avatar_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/profile_update_avatar_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/profile_update_banner_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/profile_update_banner_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/profile_update_params.rbs +5 -0
- data/sig/x_twitter_scraper/models/x/profile_update_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweet_author.rbs +3 -11
- data/sig/x_twitter_scraper/models/x/tweet_create_params.rbs +4 -6
- data/sig/x_twitter_scraper/models/x/tweet_create_response.rbs +518 -11
- data/sig/x_twitter_scraper/models/x/tweet_delete_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweet_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/like_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/like_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/like_delete_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/like_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/retweet_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/retweet_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/tweets/retweet_delete_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/tweets/retweet_delete_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/user_remove_follower_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/user_remove_follower_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/users/follow_create_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/users/follow_create_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/users/follow_delete_all_params.rbs +5 -1
- data/sig/x_twitter_scraper/models/x/users/follow_delete_all_response.rbs +540 -4
- data/sig/x_twitter_scraper/models/x/write_action_retrieve_response.rbs +428 -54
- data/sig/x_twitter_scraper/resources/compose.rbs +2 -12
- data/sig/x_twitter_scraper/resources/support/tickets.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/communities/join.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/communities.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/dm.rbs +1 -0
- data/sig/x_twitter_scraper/resources/x/media.rbs +1 -0
- data/sig/x_twitter_scraper/resources/x/profile.rbs +3 -0
- data/sig/x_twitter_scraper/resources/x/tweets/like.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/tweets/retweet.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/tweets.rbs +2 -1
- data/sig/x_twitter_scraper/resources/x/users/follow.rbs +2 -0
- data/sig/x_twitter_scraper/resources/x/users.rbs +1 -0
- metadata +17 -26
|
@@ -16,7 +16,7 @@ module XTwitterScraper
|
|
|
16
16
|
sig do
|
|
17
17
|
params(
|
|
18
18
|
account: String,
|
|
19
|
-
|
|
19
|
+
idempotency_key: String,
|
|
20
20
|
community_id: String,
|
|
21
21
|
is_note_tweet: T::Boolean,
|
|
22
22
|
media: T::Array[String],
|
|
@@ -26,23 +26,30 @@ module XTwitterScraper
|
|
|
26
26
|
).returns(XTwitterScraper::Models::X::TweetCreateResponse)
|
|
27
27
|
end
|
|
28
28
|
def create(
|
|
29
|
-
# X account (@username or account ID)
|
|
29
|
+
# Body param: X account (@username or account ID)
|
|
30
30
|
account:,
|
|
31
|
-
|
|
31
|
+
# Header param: Generate one unique value for each intended write. Reuse it only
|
|
32
|
+
# when retrying the exact same account, action, target, and payload. A reused key
|
|
33
|
+
# returns the original action. Reusing it with different input returns 409. Replay
|
|
34
|
+
# protection remains active for at least 90 days.
|
|
35
|
+
idempotency_key:,
|
|
36
|
+
# Body param
|
|
32
37
|
community_id: nil,
|
|
38
|
+
# Body param
|
|
33
39
|
is_note_tweet: nil,
|
|
34
|
-
# Array of public media URLs to attach. Supports up to 4 images or
|
|
35
|
-
# video up to 100 MB. Each URL must be publicly reachable. Attached
|
|
36
|
-
# credits per started MB across all files.
|
|
40
|
+
# Body param: Array of public media URLs to attach. Supports up to 4 images or
|
|
41
|
+
# exactly 1 MP4 video up to 100 MB. Each URL must be publicly reachable. Attached
|
|
42
|
+
# media adds 2 credits per started MB across all files.
|
|
37
43
|
media: nil,
|
|
44
|
+
# Body param
|
|
38
45
|
reply_to_tweet_id: nil,
|
|
39
|
-
# Tweet text (optional when media is provided)
|
|
46
|
+
# Body param: Tweet text (optional when media is provided)
|
|
40
47
|
text: nil,
|
|
41
48
|
request_options: {}
|
|
42
49
|
)
|
|
43
50
|
end
|
|
44
51
|
|
|
45
|
-
# Get tweet with full text, author, metrics
|
|
52
|
+
# Get tweet with full text, author, metrics & media
|
|
46
53
|
sig do
|
|
47
54
|
params(
|
|
48
55
|
id: String,
|
|
@@ -75,19 +82,27 @@ module XTwitterScraper
|
|
|
75
82
|
params(
|
|
76
83
|
id: String,
|
|
77
84
|
account: String,
|
|
85
|
+
idempotency_key: String,
|
|
78
86
|
request_options: XTwitterScraper::RequestOptions::OrHash
|
|
79
87
|
).returns(XTwitterScraper::Models::X::TweetDeleteResponse)
|
|
80
88
|
end
|
|
81
89
|
def delete(
|
|
82
|
-
# Tweet ID to delete
|
|
90
|
+
# Path param: Tweet ID to delete
|
|
83
91
|
id,
|
|
84
|
-
# X account identifier (@username or account ID)
|
|
92
|
+
# Body param: X account identifier (@username or account ID)
|
|
85
93
|
account:,
|
|
94
|
+
# Header param: Generate one unique value for each intended write. Reuse it only
|
|
95
|
+
# when retrying the exact same account, action, target, and payload. A reused key
|
|
96
|
+
# returns the original action. Reusing it with different input returns 409. Replay
|
|
97
|
+
# protection remains active for at least 90 days.
|
|
98
|
+
idempotency_key:,
|
|
86
99
|
request_options: {}
|
|
87
100
|
)
|
|
88
101
|
end
|
|
89
102
|
|
|
90
|
-
#
|
|
103
|
+
# Returns liker profiles that X makes visible for the post. X can withhold liker
|
|
104
|
+
# identities even when the post reports likes. In that case this endpoint returns
|
|
105
|
+
# 424 `favoriters_unavailable` instead of a misleading empty success.
|
|
91
106
|
sig do
|
|
92
107
|
params(
|
|
93
108
|
id: String,
|
|
@@ -222,7 +237,11 @@ module XTwitterScraper
|
|
|
222
237
|
)
|
|
223
238
|
end
|
|
224
239
|
|
|
225
|
-
#
|
|
240
|
+
# Returns visible replies. For an unfiltered first page, Xquik compares a terminal
|
|
241
|
+
# page with the post's reported reply count. If the page is visibly incomplete,
|
|
242
|
+
# the endpoint returns 424 `replies_incomplete` instead of presenting partial
|
|
243
|
+
# coverage as complete. Use tweet search with a `conversation_id:{id}` query as
|
|
244
|
+
# the broader fallback.
|
|
226
245
|
sig do
|
|
227
246
|
params(
|
|
228
247
|
id: String,
|
|
@@ -11,14 +11,20 @@ module XTwitterScraper
|
|
|
11
11
|
params(
|
|
12
12
|
id: String,
|
|
13
13
|
account: String,
|
|
14
|
+
idempotency_key: String,
|
|
14
15
|
request_options: XTwitterScraper::RequestOptions::OrHash
|
|
15
16
|
).returns(XTwitterScraper::Models::X::Users::FollowCreateResponse)
|
|
16
17
|
end
|
|
17
18
|
def create(
|
|
18
|
-
# User ID to follow
|
|
19
|
+
# Path param: User ID to follow
|
|
19
20
|
id,
|
|
20
|
-
# X account identifier (@username or account ID)
|
|
21
|
+
# Body param: X account identifier (@username or account ID)
|
|
21
22
|
account:,
|
|
23
|
+
# Header param: Generate one unique value for each intended write. Reuse it only
|
|
24
|
+
# when retrying the exact same account, action, target, and payload. A reused key
|
|
25
|
+
# returns the original action. Reusing it with different input returns 409. Replay
|
|
26
|
+
# protection remains active for at least 90 days.
|
|
27
|
+
idempotency_key:,
|
|
22
28
|
request_options: {}
|
|
23
29
|
)
|
|
24
30
|
end
|
|
@@ -28,16 +34,22 @@ module XTwitterScraper
|
|
|
28
34
|
params(
|
|
29
35
|
id: String,
|
|
30
36
|
account: String,
|
|
37
|
+
idempotency_key: String,
|
|
31
38
|
request_options: XTwitterScraper::RequestOptions::OrHash
|
|
32
39
|
).returns(
|
|
33
40
|
XTwitterScraper::Models::X::Users::FollowDeleteAllResponse
|
|
34
41
|
)
|
|
35
42
|
end
|
|
36
43
|
def delete_all(
|
|
37
|
-
# User ID to unfollow
|
|
44
|
+
# Path param: User ID to unfollow
|
|
38
45
|
id,
|
|
39
|
-
# X account identifier (@username or account ID)
|
|
46
|
+
# Body param: X account identifier (@username or account ID)
|
|
40
47
|
account:,
|
|
48
|
+
# Header param: Generate one unique value for each intended write. Reuse it only
|
|
49
|
+
# when retrying the exact same account, action, target, and payload. A reused key
|
|
50
|
+
# returns the original action. Reusing it with different input returns 409. Replay
|
|
51
|
+
# protection remains active for at least 90 days.
|
|
52
|
+
idempotency_key:,
|
|
41
53
|
request_options: {}
|
|
42
54
|
)
|
|
43
55
|
end
|
|
@@ -8,7 +8,7 @@ module XTwitterScraper
|
|
|
8
8
|
sig { returns(XTwitterScraper::Resources::X::Users::Follow) }
|
|
9
9
|
attr_reader :follow
|
|
10
10
|
|
|
11
|
-
# Get user profile with follower counts
|
|
11
|
+
# Get user profile with follower counts & verification
|
|
12
12
|
sig do
|
|
13
13
|
params(
|
|
14
14
|
id: String,
|
|
@@ -27,14 +27,20 @@ module XTwitterScraper
|
|
|
27
27
|
params(
|
|
28
28
|
id: String,
|
|
29
29
|
account: String,
|
|
30
|
+
idempotency_key: String,
|
|
30
31
|
request_options: XTwitterScraper::RequestOptions::OrHash
|
|
31
32
|
).returns(XTwitterScraper::Models::X::UserRemoveFollowerResponse)
|
|
32
33
|
end
|
|
33
34
|
def remove_follower(
|
|
34
|
-
# User ID to remove from your followers
|
|
35
|
+
# Path param: User ID to remove from your followers
|
|
35
36
|
id,
|
|
36
|
-
# X account identifier (@username or account ID)
|
|
37
|
+
# Body param: X account identifier (@username or account ID)
|
|
37
38
|
account:,
|
|
39
|
+
# Header param: Generate one unique value for each intended write. Reuse it only
|
|
40
|
+
# when retrying the exact same account, action, target, and payload. A reused key
|
|
41
|
+
# returns the original action. Reusing it with different input returns 409. Replay
|
|
42
|
+
# protection remains active for at least 90 days.
|
|
43
|
+
idempotency_key:,
|
|
38
44
|
request_options: {}
|
|
39
45
|
)
|
|
40
46
|
end
|
|
@@ -66,7 +72,7 @@ module XTwitterScraper
|
|
|
66
72
|
).returns(XTwitterScraper::PaginatedUsers)
|
|
67
73
|
end
|
|
68
74
|
def retrieve_followers(
|
|
69
|
-
#
|
|
75
|
+
# Target user ID or username for follower lookup.
|
|
70
76
|
id,
|
|
71
77
|
# Legacy cursor alias. Prefer cursor.
|
|
72
78
|
after: nil,
|
|
@@ -120,7 +126,7 @@ module XTwitterScraper
|
|
|
120
126
|
def retrieve_following(
|
|
121
127
|
# User ID or username for following lookup
|
|
122
128
|
id,
|
|
123
|
-
#
|
|
129
|
+
# Deprecated following cursor alias. Prefer cursor.
|
|
124
130
|
after: nil,
|
|
125
131
|
# Pagination cursor for following list
|
|
126
132
|
cursor: nil,
|
|
@@ -493,7 +499,7 @@ module XTwitterScraper
|
|
|
493
499
|
).returns(XTwitterScraper::PaginatedTweets)
|
|
494
500
|
end
|
|
495
501
|
def retrieve_replies(
|
|
496
|
-
#
|
|
502
|
+
# Target user ID or username for the replies timeline.
|
|
497
503
|
id,
|
|
498
504
|
# Words or quoted phrases where any one can match. Separate with spaces, commas,
|
|
499
505
|
# or lines.
|
|
@@ -512,7 +518,7 @@ module XTwitterScraper
|
|
|
512
518
|
from_user: nil,
|
|
513
519
|
# Hashtags separated by spaces, commas, or lines.
|
|
514
520
|
hashtags: nil,
|
|
515
|
-
# Include parent tweet
|
|
521
|
+
# Include each reply's parent tweet.
|
|
516
522
|
include_parent_tweet: nil,
|
|
517
523
|
# Only replies to this tweet ID.
|
|
518
524
|
in_reply_to_tweet_id: nil,
|
|
@@ -20,7 +20,6 @@ module XTwitterScraper
|
|
|
20
20
|
sig { returns(XTwitterScraper::Resources::X::Dm) }
|
|
21
21
|
attr_reader :dm
|
|
22
22
|
|
|
23
|
-
# Media upload and download
|
|
24
23
|
sig { returns(XTwitterScraper::Resources::X::Media) }
|
|
25
24
|
attr_reader :media
|
|
26
25
|
|
|
@@ -99,7 +98,7 @@ module XTwitterScraper
|
|
|
99
98
|
)
|
|
100
99
|
end
|
|
101
100
|
|
|
102
|
-
# Get trending hashtags
|
|
101
|
+
# Get trending hashtags & topics from X by region
|
|
103
102
|
sig do
|
|
104
103
|
params(
|
|
105
104
|
count: Integer,
|
|
@@ -1,136 +1,196 @@
|
|
|
1
1
|
module XTwitterScraper
|
|
2
2
|
module Models
|
|
3
3
|
type compose_create_params =
|
|
4
|
-
{
|
|
5
|
-
step: XTwitterScraper::Models::ComposeCreateParams::step,
|
|
6
|
-
additional_context: String,
|
|
7
|
-
call_to_action: String,
|
|
8
|
-
draft: String,
|
|
9
|
-
goal: XTwitterScraper::Models::ComposeCreateParams::goal,
|
|
10
|
-
has_link: bool,
|
|
11
|
-
has_media: bool,
|
|
12
|
-
media_type: XTwitterScraper::Models::ComposeCreateParams::media_type,
|
|
13
|
-
style_username: String,
|
|
14
|
-
tone: String,
|
|
15
|
-
topic: String
|
|
16
|
-
}
|
|
4
|
+
{ body: XTwitterScraper::Models::ComposeCreateParams::body }
|
|
17
5
|
& XTwitterScraper::Internal::Type::request_parameters
|
|
18
6
|
|
|
19
7
|
class ComposeCreateParams < XTwitterScraper::Internal::Type::BaseModel
|
|
20
8
|
extend XTwitterScraper::Internal::Type::RequestParameters::Converter
|
|
21
9
|
include XTwitterScraper::Internal::Type::RequestParameters
|
|
22
10
|
|
|
23
|
-
attr_accessor
|
|
11
|
+
attr_accessor body: XTwitterScraper::Models::ComposeCreateParams::body
|
|
24
12
|
|
|
25
|
-
|
|
13
|
+
def initialize: (
|
|
14
|
+
body: XTwitterScraper::Models::ComposeCreateParams::body,
|
|
15
|
+
?request_options: XTwitterScraper::request_opts
|
|
16
|
+
) -> void
|
|
26
17
|
|
|
27
|
-
def
|
|
18
|
+
def to_hash: -> {
|
|
19
|
+
body: XTwitterScraper::Models::ComposeCreateParams::body,
|
|
20
|
+
request_options: XTwitterScraper::RequestOptions
|
|
21
|
+
}
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
type body =
|
|
24
|
+
XTwitterScraper::ComposeCreateParams::Body::ComposePrepareRequest
|
|
25
|
+
| XTwitterScraper::ComposeCreateParams::Body::ComposeRefineRequest
|
|
26
|
+
| XTwitterScraper::ComposeCreateParams::Body::ComposeScoreRequest
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
module Body
|
|
29
|
+
extend XTwitterScraper::Internal::Type::Union
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
type compose_prepare_request =
|
|
32
|
+
{
|
|
33
|
+
step: :compose,
|
|
34
|
+
topic: String,
|
|
35
|
+
goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal,
|
|
36
|
+
style_username: String
|
|
37
|
+
}
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
class ComposePrepareRequest < XTwitterScraper::Internal::Type::BaseModel
|
|
40
|
+
attr_accessor step: :compose
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
attr_accessor topic: String
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
XTwitterScraper::Models::ComposeCreateParams::goal
|
|
41
|
-
) -> XTwitterScraper::Models::ComposeCreateParams::goal
|
|
44
|
+
attr_reader goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal?
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
def goal=: (
|
|
47
|
+
XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal
|
|
48
|
+
) -> XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
attr_reader style_username: String?
|
|
46
51
|
|
|
47
|
-
|
|
52
|
+
def style_username=: (String) -> String
|
|
48
53
|
|
|
49
|
-
|
|
54
|
+
def initialize: (
|
|
55
|
+
topic: String,
|
|
56
|
+
?goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal,
|
|
57
|
+
?style_username: String,
|
|
58
|
+
?step: :compose
|
|
59
|
+
) -> void
|
|
50
60
|
|
|
51
|
-
|
|
61
|
+
def to_hash: -> {
|
|
62
|
+
step: :compose,
|
|
63
|
+
topic: String,
|
|
64
|
+
goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal,
|
|
65
|
+
style_username: String
|
|
66
|
+
}
|
|
52
67
|
|
|
53
|
-
|
|
54
|
-
XTwitterScraper::Models::ComposeCreateParams::media_type
|
|
55
|
-
) -> XTwitterScraper::Models::ComposeCreateParams::media_type
|
|
68
|
+
type goal = :engagement | :followers | :authority | :conversation
|
|
56
69
|
|
|
57
|
-
|
|
70
|
+
module Goal
|
|
71
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
58
72
|
|
|
59
|
-
|
|
73
|
+
ENGAGEMENT: :engagement
|
|
74
|
+
FOLLOWERS: :followers
|
|
75
|
+
AUTHORITY: :authority
|
|
76
|
+
CONVERSATION: :conversation
|
|
60
77
|
|
|
61
|
-
|
|
78
|
+
def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest::goal]
|
|
79
|
+
end
|
|
80
|
+
end
|
|
62
81
|
|
|
63
|
-
|
|
82
|
+
type compose_refine_request =
|
|
83
|
+
{
|
|
84
|
+
goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal,
|
|
85
|
+
step: :refine,
|
|
86
|
+
tone: String,
|
|
87
|
+
topic: String,
|
|
88
|
+
additional_context: String,
|
|
89
|
+
call_to_action: String,
|
|
90
|
+
media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
|
|
91
|
+
}
|
|
64
92
|
|
|
65
|
-
|
|
93
|
+
class ComposeRefineRequest < XTwitterScraper::Internal::Type::BaseModel
|
|
94
|
+
attr_accessor goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal
|
|
66
95
|
|
|
67
|
-
|
|
96
|
+
attr_accessor step: :refine
|
|
68
97
|
|
|
69
|
-
|
|
70
|
-
step: XTwitterScraper::Models::ComposeCreateParams::step,
|
|
71
|
-
?additional_context: String,
|
|
72
|
-
?call_to_action: String,
|
|
73
|
-
?draft: String,
|
|
74
|
-
?goal: XTwitterScraper::Models::ComposeCreateParams::goal,
|
|
75
|
-
?has_link: bool,
|
|
76
|
-
?has_media: bool,
|
|
77
|
-
?media_type: XTwitterScraper::Models::ComposeCreateParams::media_type,
|
|
78
|
-
?style_username: String,
|
|
79
|
-
?tone: String,
|
|
80
|
-
?topic: String,
|
|
81
|
-
?request_options: XTwitterScraper::request_opts
|
|
82
|
-
) -> void
|
|
98
|
+
attr_accessor tone: String
|
|
83
99
|
|
|
84
|
-
|
|
85
|
-
step: XTwitterScraper::Models::ComposeCreateParams::step,
|
|
86
|
-
additional_context: String,
|
|
87
|
-
call_to_action: String,
|
|
88
|
-
draft: String,
|
|
89
|
-
goal: XTwitterScraper::Models::ComposeCreateParams::goal,
|
|
90
|
-
has_link: bool,
|
|
91
|
-
has_media: bool,
|
|
92
|
-
media_type: XTwitterScraper::Models::ComposeCreateParams::media_type,
|
|
93
|
-
style_username: String,
|
|
94
|
-
tone: String,
|
|
95
|
-
topic: String,
|
|
96
|
-
request_options: XTwitterScraper::RequestOptions
|
|
97
|
-
}
|
|
100
|
+
attr_accessor topic: String
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
attr_reader additional_context: String?
|
|
100
103
|
|
|
101
|
-
|
|
102
|
-
extend XTwitterScraper::Internal::Type::Enum
|
|
104
|
+
def additional_context=: (String) -> String
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
REFINE: :refine
|
|
106
|
-
SCORE: :score
|
|
106
|
+
attr_reader call_to_action: String?
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
end
|
|
108
|
+
def call_to_action=: (String) -> String
|
|
110
109
|
|
|
111
|
-
|
|
110
|
+
attr_reader media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type?
|
|
112
111
|
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
def media_type=: (
|
|
113
|
+
XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
|
|
114
|
+
) -> XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
|
|
115
115
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
def initialize: (
|
|
117
|
+
goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal,
|
|
118
|
+
tone: String,
|
|
119
|
+
topic: String,
|
|
120
|
+
?additional_context: String,
|
|
121
|
+
?call_to_action: String,
|
|
122
|
+
?media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type,
|
|
123
|
+
?step: :refine
|
|
124
|
+
) -> void
|
|
120
125
|
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
def to_hash: -> {
|
|
127
|
+
goal: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal,
|
|
128
|
+
step: :refine,
|
|
129
|
+
tone: String,
|
|
130
|
+
topic: String,
|
|
131
|
+
additional_context: String,
|
|
132
|
+
call_to_action: String,
|
|
133
|
+
media_type: XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
type goal = :engagement | :followers | :authority | :conversation
|
|
137
|
+
|
|
138
|
+
module Goal
|
|
139
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
140
|
+
|
|
141
|
+
ENGAGEMENT: :engagement
|
|
142
|
+
FOLLOWERS: :followers
|
|
143
|
+
AUTHORITY: :authority
|
|
144
|
+
CONVERSATION: :conversation
|
|
145
|
+
|
|
146
|
+
def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::goal]
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
type media_type = :photo | :video | :none
|
|
150
|
+
|
|
151
|
+
module MediaType
|
|
152
|
+
extend XTwitterScraper::Internal::Type::Enum
|
|
153
|
+
|
|
154
|
+
PHOTO: :photo
|
|
155
|
+
VIDEO: :video
|
|
156
|
+
NONE: :none
|
|
157
|
+
|
|
158
|
+
def self?.values: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest::media_type]
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
type compose_score_request =
|
|
163
|
+
{ draft: String, step: :score, has_link: bool, has_media: bool }
|
|
164
|
+
|
|
165
|
+
class ComposeScoreRequest < XTwitterScraper::Internal::Type::BaseModel
|
|
166
|
+
attr_accessor draft: String
|
|
167
|
+
|
|
168
|
+
attr_accessor step: :score
|
|
169
|
+
|
|
170
|
+
attr_reader has_link: bool?
|
|
171
|
+
|
|
172
|
+
def has_link=: (bool) -> bool
|
|
173
|
+
|
|
174
|
+
attr_reader has_media: bool?
|
|
123
175
|
|
|
124
|
-
|
|
176
|
+
def has_media=: (bool) -> bool
|
|
125
177
|
|
|
126
|
-
|
|
127
|
-
|
|
178
|
+
def initialize: (
|
|
179
|
+
draft: String,
|
|
180
|
+
?has_link: bool,
|
|
181
|
+
?has_media: bool,
|
|
182
|
+
?step: :score
|
|
183
|
+
) -> void
|
|
128
184
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
185
|
+
def to_hash: -> {
|
|
186
|
+
draft: String,
|
|
187
|
+
step: :score,
|
|
188
|
+
has_link: bool,
|
|
189
|
+
has_media: bool
|
|
190
|
+
}
|
|
191
|
+
end
|
|
132
192
|
|
|
133
|
-
def self?.
|
|
193
|
+
def self?.variants: -> ::Array[XTwitterScraper::Models::ComposeCreateParams::body]
|
|
134
194
|
end
|
|
135
195
|
end
|
|
136
196
|
end
|