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
|
@@ -4,35 +4,17 @@ module XTwitterScraper
|
|
|
4
4
|
module Resources
|
|
5
5
|
# AI tweet composition, drafts, writing styles, and radar
|
|
6
6
|
class Compose
|
|
7
|
-
#
|
|
7
|
+
# Run one step of Xquik's three-step writing workflow. Compose returns questions
|
|
8
|
+
# and editorial rules. Refine returns goal-specific guidance. Score applies
|
|
9
|
+
# deterministic text checks. It does not predict reach or expose X ranking
|
|
10
|
+
# weights.
|
|
8
11
|
#
|
|
9
|
-
# @overload create(
|
|
10
|
-
#
|
|
11
|
-
# @param step [Symbol, XTwitterScraper::Models::ComposeCreateParams::Step] Workflow step
|
|
12
|
-
#
|
|
13
|
-
# @param additional_context [String] Extra context or URLs (refine)
|
|
14
|
-
#
|
|
15
|
-
# @param call_to_action [String] Desired call to action (refine)
|
|
16
|
-
#
|
|
17
|
-
# @param draft [String] Tweet draft text to evaluate (score)
|
|
18
|
-
#
|
|
19
|
-
# @param goal [Symbol, XTwitterScraper::Models::ComposeCreateParams::Goal] Optimization goal
|
|
20
|
-
#
|
|
21
|
-
# @param has_link [Boolean] Whether a link is attached (score)
|
|
22
|
-
#
|
|
23
|
-
# @param has_media [Boolean] Whether media is attached (score)
|
|
24
|
-
#
|
|
25
|
-
# @param media_type [Symbol, XTwitterScraper::Models::ComposeCreateParams::MediaType] Media type (refine)
|
|
26
|
-
#
|
|
27
|
-
# @param style_username [String] Cached style username for voice matching (compose)
|
|
28
|
-
#
|
|
29
|
-
# @param tone [String] Desired tone (refine)
|
|
30
|
-
#
|
|
31
|
-
# @param topic [String] Tweet topic (compose, refine)
|
|
12
|
+
# @overload create(body:, request_options: {})
|
|
32
13
|
#
|
|
14
|
+
# @param body [XTwitterScraper::Models::ComposeCreateParams::Body::ComposePrepareRequest, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeRefineRequest, XTwitterScraper::Models::ComposeCreateParams::Body::ComposeScoreRequest]
|
|
33
15
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
34
16
|
#
|
|
35
|
-
# @return [XTwitterScraper::Models::ComposeCreateResponse]
|
|
17
|
+
# @return [XTwitterScraper::Models::ComposeCreateResponse::ComposePrepareResult, XTwitterScraper::Models::ComposeCreateResponse::ComposeRefineResult, XTwitterScraper::Models::ComposeCreateResponse::ComposeScoreResult]
|
|
36
18
|
#
|
|
37
19
|
# @see XTwitterScraper::Models::ComposeCreateParams
|
|
38
20
|
def create(params)
|
|
@@ -40,7 +22,7 @@ module XTwitterScraper
|
|
|
40
22
|
@client.request(
|
|
41
23
|
method: :post,
|
|
42
24
|
path: "compose",
|
|
43
|
-
body: parsed,
|
|
25
|
+
body: parsed[:body],
|
|
44
26
|
model: XTwitterScraper::Models::ComposeCreateResponse,
|
|
45
27
|
options: options
|
|
46
28
|
)
|
|
@@ -50,7 +50,7 @@ module XTwitterScraper
|
|
|
50
50
|
#
|
|
51
51
|
# @overload retrieve_topup_status(session_id:, request_options: {})
|
|
52
52
|
#
|
|
53
|
-
# @param session_id [String]
|
|
53
|
+
# @param session_id [String] Top-up session ID to inspect.
|
|
54
54
|
#
|
|
55
55
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
56
56
|
#
|
|
@@ -126,15 +126,15 @@ module XTwitterScraper
|
|
|
126
126
|
#
|
|
127
127
|
# @param retweets_of_tweet_id [String] Estimate only retweets of this tweet ID (tweet_search_extractor)
|
|
128
128
|
#
|
|
129
|
-
# @param search_query [String]
|
|
129
|
+
# @param search_query [String] Query used to price tweet_search_extractor or community_search.
|
|
130
130
|
#
|
|
131
131
|
# @param since_date [Date] Estimate start date in YYYY-MM-DD format (tweet_search_extractor)
|
|
132
132
|
#
|
|
133
|
-
# @param target_community_id [String]
|
|
133
|
+
# @param target_community_id [String] Community ID used to price community_post_extractor or community_search.
|
|
134
134
|
#
|
|
135
|
-
# @param target_list_id [String]
|
|
135
|
+
# @param target_list_id [String] List ID used to price list_follower_explorer, list_member_extractor, or list_pos
|
|
136
136
|
#
|
|
137
|
-
# @param target_space_id [String]
|
|
137
|
+
# @param target_space_id [String] Space ID used to price space_explorer.
|
|
138
138
|
#
|
|
139
139
|
# @param target_tweet_id [String]
|
|
140
140
|
#
|
|
@@ -15,7 +15,7 @@ module XTwitterScraper
|
|
|
15
15
|
#
|
|
16
16
|
# @overload create(amount_minor:, idempotency_key:, currency: :usd, request_options: {})
|
|
17
17
|
#
|
|
18
|
-
# @param amount_minor [Integer] Body param:
|
|
18
|
+
# @param amount_minor [Integer] Body param: USD cents accepted for this checkout.
|
|
19
19
|
#
|
|
20
20
|
# @param idempotency_key [String] Header param: Generate a cryptographically random UUID v4. Reuse it only to retr
|
|
21
21
|
#
|
|
@@ -72,7 +72,7 @@ module XTwitterScraper
|
|
|
72
72
|
#
|
|
73
73
|
# @overload topup(amount_minor:, idempotency_key:, currency: :usd, request_options: {})
|
|
74
74
|
#
|
|
75
|
-
# @param amount_minor [Integer] Body param:
|
|
75
|
+
# @param amount_minor [Integer] Body param: USD cents accepted for this checkout.
|
|
76
76
|
#
|
|
77
77
|
# @param idempotency_key [String] Header param: Generate a cryptographically random UUID v4. Reuse it only to retr
|
|
78
78
|
#
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
module XTwitterScraper
|
|
4
4
|
module Resources
|
|
5
5
|
class Monitors
|
|
6
|
-
#
|
|
6
|
+
# X account monitoring with 1-second checks
|
|
7
7
|
class Keywords
|
|
8
|
-
# Creates
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
# hourly charge.
|
|
8
|
+
# Creates a keyword monitor. Keyword monitors are unlimited. Active monitors check
|
|
9
|
+
# every 1 second and cost 21 credits per hour. Events and webhook deliveries are
|
|
10
|
+
# included. Creation requires available credits for the first hourly charge.
|
|
12
11
|
#
|
|
13
12
|
# @overload create(event_types:, query:, request_options: {})
|
|
14
13
|
#
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module XTwitterScraper
|
|
4
4
|
module Resources
|
|
5
|
-
#
|
|
5
|
+
# X account monitoring with 1-second checks
|
|
6
6
|
class Monitors
|
|
7
|
-
#
|
|
7
|
+
# X account monitoring with 1-second checks
|
|
8
8
|
# @return [XTwitterScraper::Resources::Monitors::Keywords]
|
|
9
9
|
attr_reader :keywords
|
|
10
10
|
|
|
11
|
-
# Creates an
|
|
11
|
+
# Creates an account monitor. Monitors are unlimited. Active monitors check every
|
|
12
12
|
# 1 second and cost 21 credits per hour. Events and webhook deliveries are
|
|
13
13
|
# included. Creation requires available credits for the first hourly charge and
|
|
14
14
|
# username lookup.
|
|
@@ -5,12 +5,19 @@ module XTwitterScraper
|
|
|
5
5
|
class Support
|
|
6
6
|
# Support ticket management
|
|
7
7
|
class Tickets
|
|
8
|
+
# Some parameter documentations has been truncated, see
|
|
9
|
+
# {XTwitterScraper::Models::Support::TicketCreateParams} for more details.
|
|
10
|
+
#
|
|
8
11
|
# Create a support ticket
|
|
9
12
|
#
|
|
10
|
-
# @overload create(body:, subject:, request_options: {})
|
|
13
|
+
# @overload create(body:, subject:, idempotency_key: nil, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param body [String] Body param
|
|
16
|
+
#
|
|
17
|
+
# @param subject [String] Body param
|
|
18
|
+
#
|
|
19
|
+
# @param idempotency_key [String] Header param: Generate one random value per ticket or reply. Reuse it only when
|
|
11
20
|
#
|
|
12
|
-
# @param body [String]
|
|
13
|
-
# @param subject [String]
|
|
14
21
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
15
22
|
#
|
|
16
23
|
# @return [XTwitterScraper::Models::Support::TicketCreateResponse]
|
|
@@ -18,10 +25,12 @@ module XTwitterScraper
|
|
|
18
25
|
# @see XTwitterScraper::Models::Support::TicketCreateParams
|
|
19
26
|
def create(params)
|
|
20
27
|
parsed, options = XTwitterScraper::Support::TicketCreateParams.dump_request(params)
|
|
28
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
21
29
|
@client.request(
|
|
22
30
|
method: :post,
|
|
23
31
|
path: "support/tickets",
|
|
24
|
-
|
|
32
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
33
|
+
body: parsed.except(*header_params.keys),
|
|
25
34
|
model: XTwitterScraper::Models::Support::TicketCreateResponse,
|
|
26
35
|
options: options
|
|
27
36
|
)
|
|
@@ -89,13 +98,18 @@ module XTwitterScraper
|
|
|
89
98
|
)
|
|
90
99
|
end
|
|
91
100
|
|
|
101
|
+
# Some parameter documentations has been truncated, see
|
|
102
|
+
# {XTwitterScraper::Models::Support::TicketReplyParams} for more details.
|
|
103
|
+
#
|
|
92
104
|
# Reply to a support ticket
|
|
93
105
|
#
|
|
94
|
-
# @overload reply(id, body:, request_options: {})
|
|
106
|
+
# @overload reply(id, body:, idempotency_key: nil, request_options: {})
|
|
95
107
|
#
|
|
96
|
-
# @param id [String] Support ticket public ID for the reply
|
|
108
|
+
# @param id [String] Path param: Support ticket public ID for the reply
|
|
97
109
|
#
|
|
98
|
-
# @param body [String]
|
|
110
|
+
# @param body [String] Body param
|
|
111
|
+
#
|
|
112
|
+
# @param idempotency_key [String] Header param: Generate one random value per ticket or reply. Reuse it only when
|
|
99
113
|
#
|
|
100
114
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
101
115
|
#
|
|
@@ -104,10 +118,12 @@ module XTwitterScraper
|
|
|
104
118
|
# @see XTwitterScraper::Models::Support::TicketReplyParams
|
|
105
119
|
def reply(id, params)
|
|
106
120
|
parsed, options = XTwitterScraper::Support::TicketReplyParams.dump_request(params)
|
|
121
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
107
122
|
@client.request(
|
|
108
123
|
method: :post,
|
|
109
124
|
path: ["support/tickets/%1$s/messages", id],
|
|
110
|
-
|
|
125
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
126
|
+
body: parsed.except(*header_params.keys),
|
|
111
127
|
model: XTwitterScraper::Models::Support::TicketReplyResponse,
|
|
112
128
|
options: options
|
|
113
129
|
)
|
|
@@ -7,7 +7,7 @@ module XTwitterScraper
|
|
|
7
7
|
# Some parameter documentations has been truncated, see
|
|
8
8
|
# {XTwitterScraper::Models::TrendListParams} for more details.
|
|
9
9
|
#
|
|
10
|
-
# Get trending hashtags
|
|
10
|
+
# Get trending hashtags & topics by region (alias)
|
|
11
11
|
#
|
|
12
12
|
# @overload list(count: nil, woeid: nil, request_options: {})
|
|
13
13
|
#
|
|
@@ -6,13 +6,18 @@ module XTwitterScraper
|
|
|
6
6
|
class Communities
|
|
7
7
|
# X write actions (tweets, likes, follows, DMs)
|
|
8
8
|
class Join
|
|
9
|
+
# Some parameter documentations has been truncated, see
|
|
10
|
+
# {XTwitterScraper::Models::X::Communities::JoinCreateParams} for more details.
|
|
11
|
+
#
|
|
9
12
|
# Join community
|
|
10
13
|
#
|
|
11
|
-
# @overload create(id, account:, request_options: {})
|
|
14
|
+
# @overload create(id, account:, idempotency_key:, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param id [String] Path param: Resource ID returned by the matching create or list endpoint.
|
|
12
17
|
#
|
|
13
|
-
# @param
|
|
18
|
+
# @param account [String] Body param: X account identifier (@username or account ID)
|
|
14
19
|
#
|
|
15
|
-
# @param
|
|
20
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
16
21
|
#
|
|
17
22
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
18
23
|
#
|
|
@@ -21,22 +26,29 @@ module XTwitterScraper
|
|
|
21
26
|
# @see XTwitterScraper::Models::X::Communities::JoinCreateParams
|
|
22
27
|
def create(id, params)
|
|
23
28
|
parsed, options = XTwitterScraper::X::Communities::JoinCreateParams.dump_request(params)
|
|
29
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
24
30
|
@client.request(
|
|
25
31
|
method: :post,
|
|
26
32
|
path: ["x/communities/%1$s/join", id],
|
|
27
|
-
|
|
33
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
34
|
+
body: parsed.except(*header_params.keys),
|
|
28
35
|
model: XTwitterScraper::Models::X::Communities::JoinCreateResponse,
|
|
29
36
|
options: options
|
|
30
37
|
)
|
|
31
38
|
end
|
|
32
39
|
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {XTwitterScraper::Models::X::Communities::JoinDeleteAllParams} for more details.
|
|
42
|
+
#
|
|
33
43
|
# Leave community
|
|
34
44
|
#
|
|
35
|
-
# @overload delete_all(id, account:, request_options: {})
|
|
45
|
+
# @overload delete_all(id, account:, idempotency_key:, request_options: {})
|
|
46
|
+
#
|
|
47
|
+
# @param id [String] Path param: Resource ID returned by the matching create or list endpoint.
|
|
36
48
|
#
|
|
37
|
-
# @param
|
|
49
|
+
# @param account [String] Body param: X account identifier (@username or account ID)
|
|
38
50
|
#
|
|
39
|
-
# @param
|
|
51
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
40
52
|
#
|
|
41
53
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
42
54
|
#
|
|
@@ -45,10 +57,12 @@ module XTwitterScraper
|
|
|
45
57
|
# @see XTwitterScraper::Models::X::Communities::JoinDeleteAllParams
|
|
46
58
|
def delete_all(id, params)
|
|
47
59
|
parsed, options = XTwitterScraper::X::Communities::JoinDeleteAllParams.dump_request(params)
|
|
60
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
48
61
|
@client.request(
|
|
49
62
|
method: :delete,
|
|
50
63
|
path: ["x/communities/%1$s/join", id],
|
|
51
|
-
|
|
64
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
65
|
+
body: parsed.except(*header_params.keys),
|
|
52
66
|
model: XTwitterScraper::Models::X::Communities::JoinDeleteAllResponse,
|
|
53
67
|
options: options
|
|
54
68
|
)
|
|
@@ -12,15 +12,20 @@ module XTwitterScraper
|
|
|
12
12
|
# @return [XTwitterScraper::Resources::X::Communities::Tweets]
|
|
13
13
|
attr_reader :tweets
|
|
14
14
|
|
|
15
|
+
# Some parameter documentations has been truncated, see
|
|
16
|
+
# {XTwitterScraper::Models::X::CommunityCreateParams} for more details.
|
|
17
|
+
#
|
|
15
18
|
# Create community
|
|
16
19
|
#
|
|
17
|
-
# @overload create(account:, name:, description: nil, request_options: {})
|
|
20
|
+
# @overload create(account:, name:, idempotency_key:, description: nil, request_options: {})
|
|
21
|
+
#
|
|
22
|
+
# @param account [String] Body param: X account (@username or ID) creating the community
|
|
18
23
|
#
|
|
19
|
-
# @param
|
|
24
|
+
# @param name [String] Body param: Community name
|
|
20
25
|
#
|
|
21
|
-
# @param
|
|
26
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
22
27
|
#
|
|
23
|
-
# @param description [String] Community description
|
|
28
|
+
# @param description [String] Body param: Community description
|
|
24
29
|
#
|
|
25
30
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
26
31
|
#
|
|
@@ -29,24 +34,31 @@ module XTwitterScraper
|
|
|
29
34
|
# @see XTwitterScraper::Models::X::CommunityCreateParams
|
|
30
35
|
def create(params)
|
|
31
36
|
parsed, options = XTwitterScraper::X::CommunityCreateParams.dump_request(params)
|
|
37
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
32
38
|
@client.request(
|
|
33
39
|
method: :post,
|
|
34
40
|
path: "x/communities",
|
|
35
|
-
|
|
41
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
42
|
+
body: parsed.except(*header_params.keys),
|
|
36
43
|
model: XTwitterScraper::Models::X::CommunityCreateResponse,
|
|
37
44
|
options: options
|
|
38
45
|
)
|
|
39
46
|
end
|
|
40
47
|
|
|
48
|
+
# Some parameter documentations has been truncated, see
|
|
49
|
+
# {XTwitterScraper::Models::X::CommunityDeleteParams} for more details.
|
|
50
|
+
#
|
|
41
51
|
# Delete community
|
|
42
52
|
#
|
|
43
|
-
# @overload delete(id, account:, community_name:, request_options: {})
|
|
53
|
+
# @overload delete(id, account:, community_name:, idempotency_key:, request_options: {})
|
|
54
|
+
#
|
|
55
|
+
# @param id [String] Path param: Resource ID returned by the matching create or list endpoint.
|
|
44
56
|
#
|
|
45
|
-
# @param
|
|
57
|
+
# @param account [String] Body param: X account (@username or ID) deleting the community
|
|
46
58
|
#
|
|
47
|
-
# @param
|
|
59
|
+
# @param community_name [String] Body param: Community name for confirmation
|
|
48
60
|
#
|
|
49
|
-
# @param
|
|
61
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
50
62
|
#
|
|
51
63
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
52
64
|
#
|
|
@@ -55,16 +67,18 @@ module XTwitterScraper
|
|
|
55
67
|
# @see XTwitterScraper::Models::X::CommunityDeleteParams
|
|
56
68
|
def delete(id, params)
|
|
57
69
|
parsed, options = XTwitterScraper::X::CommunityDeleteParams.dump_request(params)
|
|
70
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
58
71
|
@client.request(
|
|
59
72
|
method: :delete,
|
|
60
73
|
path: ["x/communities/%1$s", id],
|
|
61
|
-
|
|
74
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
75
|
+
body: parsed.except(*header_params.keys),
|
|
62
76
|
model: XTwitterScraper::Models::X::CommunityDeleteResponse,
|
|
63
77
|
options: options
|
|
64
78
|
)
|
|
65
79
|
end
|
|
66
80
|
|
|
67
|
-
# Get community name, description
|
|
81
|
+
# Get community name, description & member count
|
|
68
82
|
#
|
|
69
83
|
# @overload retrieve_info(id, request_options: {})
|
|
70
84
|
#
|
|
@@ -36,17 +36,22 @@ module XTwitterScraper
|
|
|
36
36
|
)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
# Some parameter documentations has been truncated, see
|
|
40
|
+
# {XTwitterScraper::Models::X::DmSendParams} for more details.
|
|
41
|
+
#
|
|
39
42
|
# Send direct message
|
|
40
43
|
#
|
|
41
|
-
# @overload send_(user_id, account:, text:, media_ids: nil, request_options: {})
|
|
44
|
+
# @overload send_(user_id, account:, text:, idempotency_key:, media_ids: nil, request_options: {})
|
|
45
|
+
#
|
|
46
|
+
# @param user_id [String] Path param: Recipient user ID
|
|
42
47
|
#
|
|
43
|
-
# @param
|
|
48
|
+
# @param account [String] Body param: X account (@username or ID) sending the DM
|
|
44
49
|
#
|
|
45
|
-
# @param
|
|
50
|
+
# @param text [String] Body param
|
|
46
51
|
#
|
|
47
|
-
# @param
|
|
52
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
48
53
|
#
|
|
49
|
-
# @param media_ids [Array<String>] Optional array containing exactly 1 uploaded media ID.
|
|
54
|
+
# @param media_ids [Array<String>] Body param: Optional array containing exactly 1 uploaded media ID.
|
|
50
55
|
#
|
|
51
56
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
52
57
|
#
|
|
@@ -55,10 +60,12 @@ module XTwitterScraper
|
|
|
55
60
|
# @see XTwitterScraper::Models::X::DmSendParams
|
|
56
61
|
def send_(user_id, params)
|
|
57
62
|
parsed, options = XTwitterScraper::X::DmSendParams.dump_request(params)
|
|
63
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
58
64
|
@client.request(
|
|
59
65
|
method: :post,
|
|
60
66
|
path: ["x/dm/%1$s", user_id],
|
|
61
|
-
|
|
67
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
68
|
+
body: parsed.except(*header_params.keys),
|
|
62
69
|
model: XTwitterScraper::Models::X::DmSendResponse,
|
|
63
70
|
options: options
|
|
64
71
|
)
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
module XTwitterScraper
|
|
4
4
|
module Resources
|
|
5
5
|
class X
|
|
6
|
-
# Media upload and download
|
|
7
6
|
class Media
|
|
8
|
-
# Download images
|
|
7
|
+
# Download images & videos from tweets
|
|
9
8
|
#
|
|
10
9
|
# @overload download(tweet_id: nil, tweet_ids: nil, tweet_input: nil, tweet_url: nil, request_options: {})
|
|
11
10
|
#
|
|
@@ -33,13 +32,18 @@ module XTwitterScraper
|
|
|
33
32
|
)
|
|
34
33
|
end
|
|
35
34
|
|
|
35
|
+
# Some parameter documentations has been truncated, see
|
|
36
|
+
# {XTwitterScraper::Models::X::MediaUploadParams} for more details.
|
|
37
|
+
#
|
|
36
38
|
# Upload media
|
|
37
39
|
#
|
|
38
|
-
# @overload upload(account:, url:, request_options: {})
|
|
40
|
+
# @overload upload(account:, url:, idempotency_key:, request_options: {})
|
|
41
|
+
#
|
|
42
|
+
# @param account [String] Body param: X account (@username or ID) uploading media from URL
|
|
39
43
|
#
|
|
40
|
-
# @param
|
|
44
|
+
# @param url [String] Body param: HTTPS URL to download and upload as media
|
|
41
45
|
#
|
|
42
|
-
# @param
|
|
46
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
43
47
|
#
|
|
44
48
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
45
49
|
#
|
|
@@ -48,11 +52,17 @@ module XTwitterScraper
|
|
|
48
52
|
# @see XTwitterScraper::Models::X::MediaUploadParams
|
|
49
53
|
def upload(params)
|
|
50
54
|
parsed, options = XTwitterScraper::X::MediaUploadParams.dump_request(params)
|
|
55
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
51
56
|
@client.request(
|
|
52
57
|
method: :post,
|
|
53
58
|
path: "x/media",
|
|
54
|
-
headers: {
|
|
55
|
-
|
|
59
|
+
headers: {
|
|
60
|
+
"content-type" => "multipart/form-data",
|
|
61
|
+
**parsed.slice(*header_params.keys)
|
|
62
|
+
}.transform_keys(
|
|
63
|
+
header_params
|
|
64
|
+
),
|
|
65
|
+
body: parsed.except(*header_params.keys),
|
|
56
66
|
model: XTwitterScraper::Models::X::MediaUploadResponse,
|
|
57
67
|
options: options
|
|
58
68
|
)
|
|
@@ -5,19 +5,24 @@ module XTwitterScraper
|
|
|
5
5
|
class X
|
|
6
6
|
# X write actions (tweets, likes, follows, DMs)
|
|
7
7
|
class Profile
|
|
8
|
+
# Some parameter documentations has been truncated, see
|
|
9
|
+
# {XTwitterScraper::Models::X::ProfileUpdateParams} for more details.
|
|
10
|
+
#
|
|
8
11
|
# Update X profile
|
|
9
12
|
#
|
|
10
|
-
# @overload update(account:, description: nil, location: nil, name: nil, url: nil, request_options: {})
|
|
13
|
+
# @overload update(account:, idempotency_key:, description: nil, location: nil, name: nil, url: nil, request_options: {})
|
|
14
|
+
#
|
|
15
|
+
# @param account [String] Body param: X account (@username or ID) to update profile
|
|
11
16
|
#
|
|
12
|
-
# @param
|
|
17
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
13
18
|
#
|
|
14
|
-
# @param description [String] Bio description
|
|
19
|
+
# @param description [String] Body param: Bio description
|
|
15
20
|
#
|
|
16
|
-
# @param location [String]
|
|
21
|
+
# @param location [String] Body param
|
|
17
22
|
#
|
|
18
|
-
# @param name [String] Display name
|
|
23
|
+
# @param name [String] Body param: Display name
|
|
19
24
|
#
|
|
20
|
-
# @param url [String] Website URL
|
|
25
|
+
# @param url [String] Body param: Website URL
|
|
21
26
|
#
|
|
22
27
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
23
28
|
#
|
|
@@ -26,22 +31,29 @@ module XTwitterScraper
|
|
|
26
31
|
# @see XTwitterScraper::Models::X::ProfileUpdateParams
|
|
27
32
|
def update(params)
|
|
28
33
|
parsed, options = XTwitterScraper::X::ProfileUpdateParams.dump_request(params)
|
|
34
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
29
35
|
@client.request(
|
|
30
36
|
method: :patch,
|
|
31
37
|
path: "x/profile",
|
|
32
|
-
|
|
38
|
+
headers: parsed.slice(*header_params.keys).transform_keys(header_params),
|
|
39
|
+
body: parsed.except(*header_params.keys),
|
|
33
40
|
model: XTwitterScraper::Models::X::ProfileUpdateResponse,
|
|
34
41
|
options: options
|
|
35
42
|
)
|
|
36
43
|
end
|
|
37
44
|
|
|
45
|
+
# Some parameter documentations has been truncated, see
|
|
46
|
+
# {XTwitterScraper::Models::X::ProfileUpdateAvatarParams} for more details.
|
|
47
|
+
#
|
|
38
48
|
# Update profile avatar
|
|
39
49
|
#
|
|
40
|
-
# @overload update_avatar(account:, url:, request_options: {})
|
|
50
|
+
# @overload update_avatar(account:, url:, idempotency_key:, request_options: {})
|
|
41
51
|
#
|
|
42
|
-
# @param account [String] X account (@username or ID) receiving avatar from URL
|
|
52
|
+
# @param account [String] Body param: X account (@username or ID) receiving avatar from URL
|
|
43
53
|
#
|
|
44
|
-
# @param url [String] HTTPS URL to the avatar image to download
|
|
54
|
+
# @param url [String] Body param: HTTPS URL to the avatar image to download
|
|
55
|
+
#
|
|
56
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
45
57
|
#
|
|
46
58
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
47
59
|
#
|
|
@@ -50,23 +62,34 @@ module XTwitterScraper
|
|
|
50
62
|
# @see XTwitterScraper::Models::X::ProfileUpdateAvatarParams
|
|
51
63
|
def update_avatar(params)
|
|
52
64
|
parsed, options = XTwitterScraper::X::ProfileUpdateAvatarParams.dump_request(params)
|
|
65
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
53
66
|
@client.request(
|
|
54
67
|
method: :patch,
|
|
55
68
|
path: "x/profile/avatar",
|
|
56
|
-
headers: {
|
|
57
|
-
|
|
69
|
+
headers: {
|
|
70
|
+
"content-type" => "multipart/form-data",
|
|
71
|
+
**parsed.slice(*header_params.keys)
|
|
72
|
+
}.transform_keys(
|
|
73
|
+
header_params
|
|
74
|
+
),
|
|
75
|
+
body: parsed.except(*header_params.keys),
|
|
58
76
|
model: XTwitterScraper::Models::X::ProfileUpdateAvatarResponse,
|
|
59
77
|
options: options
|
|
60
78
|
)
|
|
61
79
|
end
|
|
62
80
|
|
|
81
|
+
# Some parameter documentations has been truncated, see
|
|
82
|
+
# {XTwitterScraper::Models::X::ProfileUpdateBannerParams} for more details.
|
|
83
|
+
#
|
|
63
84
|
# Update profile banner
|
|
64
85
|
#
|
|
65
|
-
# @overload update_banner(account:, url:, request_options: {})
|
|
86
|
+
# @overload update_banner(account:, url:, idempotency_key:, request_options: {})
|
|
87
|
+
#
|
|
88
|
+
# @param account [String] Body param: X account (@username or ID) receiving banner from URL
|
|
66
89
|
#
|
|
67
|
-
# @param
|
|
90
|
+
# @param url [String] Body param: HTTPS URL to the banner image to download
|
|
68
91
|
#
|
|
69
|
-
# @param
|
|
92
|
+
# @param idempotency_key [String] Header param: Generate one unique value for each intended write. Reuse it only w
|
|
70
93
|
#
|
|
71
94
|
# @param request_options [XTwitterScraper::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
72
95
|
#
|
|
@@ -75,11 +98,17 @@ module XTwitterScraper
|
|
|
75
98
|
# @see XTwitterScraper::Models::X::ProfileUpdateBannerParams
|
|
76
99
|
def update_banner(params)
|
|
77
100
|
parsed, options = XTwitterScraper::X::ProfileUpdateBannerParams.dump_request(params)
|
|
101
|
+
header_params = {idempotency_key: "idempotency-key"}
|
|
78
102
|
@client.request(
|
|
79
103
|
method: :patch,
|
|
80
104
|
path: "x/profile/banner",
|
|
81
|
-
headers: {
|
|
82
|
-
|
|
105
|
+
headers: {
|
|
106
|
+
"content-type" => "multipart/form-data",
|
|
107
|
+
**parsed.slice(*header_params.keys)
|
|
108
|
+
}.transform_keys(
|
|
109
|
+
header_params
|
|
110
|
+
),
|
|
111
|
+
body: parsed.except(*header_params.keys),
|
|
83
112
|
model: XTwitterScraper::Models::X::ProfileUpdateBannerResponse,
|
|
84
113
|
options: options
|
|
85
114
|
)
|