x-twitter-scraper 0.18.0 → 0.19.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.
- package/CHANGELOG.md +24 -0
- package/client.d.mts +7 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/account.d.mts +1 -1
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +1 -1
- package/resources/account.d.ts.map +1 -1
- package/resources/activity.d.mts +214 -0
- package/resources/activity.d.mts.map +1 -0
- package/resources/activity.d.ts +214 -0
- package/resources/activity.d.ts.map +1 -0
- package/resources/activity.js +67 -0
- package/resources/activity.js.map +1 -0
- package/resources/activity.mjs +63 -0
- package/resources/activity.mjs.map +1 -0
- package/resources/credits.d.mts +24 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +24 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs.map +1 -1
- package/resources/events.d.mts +69 -0
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +69 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +2 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +2 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +8 -0
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +8 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +45 -1
- package/resources/monitors/posts.d.mts.map +1 -1
- package/resources/monitors/posts.d.ts +45 -1
- package/resources/monitors/posts.d.ts.map +1 -1
- package/resources/monitors/posts.js +1 -1
- package/resources/monitors/posts.mjs +1 -1
- package/resources/shared.d.mts +67 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +67 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscribe.d.mts +11 -0
- package/resources/subscribe.d.mts.map +1 -1
- package/resources/subscribe.d.ts +11 -0
- package/resources/subscribe.d.ts.map +1 -1
- package/resources/subscribe.js.map +1 -1
- package/resources/subscribe.mjs.map +1 -1
- package/resources/x/index.d.mts +1 -1
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +1 -1
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/media.d.mts +36 -0
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +36 -0
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/sports.d.mts +309 -2
- package/resources/x/sports.d.mts.map +1 -1
- package/resources/x/sports.d.ts +309 -2
- package/resources/x/sports.d.ts.map +1 -1
- package/resources/x/sports.js +49 -1
- package/resources/x/sports.js.map +1 -1
- package/resources/x/sports.mjs +49 -1
- package/resources/x/sports.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +31 -0
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +31 -0
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/x.d.mts +2 -2
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +2 -2
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/references/api-endpoints-draws.md +13 -13
- package/skills/x-twitter-scraper/references/draws.md +3 -3
- package/skills/x-twitter-scraper/references/python-examples.md +2 -2
- package/src/client.ts +23 -0
- package/src/resources/account.ts +1 -1
- package/src/resources/activity.ts +302 -0
- package/src/resources/credits.ts +29 -0
- package/src/resources/events.ts +85 -1
- package/src/resources/extractions.ts +9 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/monitors/posts.ts +58 -1
- package/src/resources/shared.ts +113 -0
- package/src/resources/subscribe.ts +13 -0
- package/src/resources/x/index.ts +10 -0
- package/src/resources/x/media.ts +50 -0
- package/src/resources/x/sports.ts +379 -1
- package/src/resources/x/tweets/tweets.ts +35 -0
- package/src/resources/x/x.ts +20 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/shared.ts
CHANGED
|
@@ -500,6 +500,43 @@ export namespace ContentDisclosure {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
+
/**
|
|
504
|
+
* ISO 4217 code of a currency Xquik charges in.
|
|
505
|
+
*/
|
|
506
|
+
export type Currency =
|
|
507
|
+
| 'USD'
|
|
508
|
+
| 'EUR'
|
|
509
|
+
| 'GBP'
|
|
510
|
+
| 'TRY'
|
|
511
|
+
| 'JPY'
|
|
512
|
+
| 'CNY'
|
|
513
|
+
| 'KRW'
|
|
514
|
+
| 'CAD'
|
|
515
|
+
| 'AUD'
|
|
516
|
+
| 'MXN'
|
|
517
|
+
| 'AED'
|
|
518
|
+
| 'BRL'
|
|
519
|
+
| 'CHF'
|
|
520
|
+
| 'CZK'
|
|
521
|
+
| 'DKK'
|
|
522
|
+
| 'HKD'
|
|
523
|
+
| 'HUF'
|
|
524
|
+
| 'IDR'
|
|
525
|
+
| 'ILS'
|
|
526
|
+
| 'INR'
|
|
527
|
+
| 'MYR'
|
|
528
|
+
| 'NOK'
|
|
529
|
+
| 'NZD'
|
|
530
|
+
| 'PHP'
|
|
531
|
+
| 'PLN'
|
|
532
|
+
| 'QAR'
|
|
533
|
+
| 'RON'
|
|
534
|
+
| 'SAR'
|
|
535
|
+
| 'SEK'
|
|
536
|
+
| 'SGD'
|
|
537
|
+
| 'THB'
|
|
538
|
+
| 'ZAR';
|
|
539
|
+
|
|
503
540
|
/**
|
|
504
541
|
* A parent, quoted or retweeted tweet. It has the TweetPublicData fields and an
|
|
505
542
|
* author. Nesting stops after 4 levels.
|
|
@@ -661,6 +698,11 @@ export interface EmbeddedTweet {
|
|
|
661
698
|
*/
|
|
662
699
|
limitedActions?: Array<SearchTweet.LimitedAction>;
|
|
663
700
|
|
|
701
|
+
/**
|
|
702
|
+
* The live event the post belongs to, such as an election.
|
|
703
|
+
*/
|
|
704
|
+
liveEventContext?: SearchTweet.LiveEventContext;
|
|
705
|
+
|
|
664
706
|
/**
|
|
665
707
|
* Media, omitted when unavailable.
|
|
666
708
|
*/
|
|
@@ -779,6 +821,12 @@ export interface EmbeddedTweet {
|
|
|
779
821
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
780
822
|
>;
|
|
781
823
|
|
|
824
|
+
/**
|
|
825
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
826
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
827
|
+
*/
|
|
828
|
+
unknownFields?: Array<'text'>;
|
|
829
|
+
|
|
782
830
|
/**
|
|
783
831
|
* User IDs that left this conversation.
|
|
784
832
|
*/
|
|
@@ -842,6 +890,7 @@ export namespace Error {
|
|
|
842
890
|
| 'account_not_found'
|
|
843
891
|
| 'account_required'
|
|
844
892
|
| 'account_restricted'
|
|
893
|
+
| 'api_key_budget_reached'
|
|
845
894
|
| 'api_key_limit_reached'
|
|
846
895
|
| 'article_not_found'
|
|
847
896
|
| 'closed'
|
|
@@ -1397,6 +1446,11 @@ export interface SearchTweet {
|
|
|
1397
1446
|
*/
|
|
1398
1447
|
limitedActions?: Array<SearchTweet.LimitedAction>;
|
|
1399
1448
|
|
|
1449
|
+
/**
|
|
1450
|
+
* The live event the post belongs to, such as an election.
|
|
1451
|
+
*/
|
|
1452
|
+
liveEventContext?: SearchTweet.LiveEventContext;
|
|
1453
|
+
|
|
1400
1454
|
/**
|
|
1401
1455
|
* Media, omitted when unavailable.
|
|
1402
1456
|
*/
|
|
@@ -1518,6 +1572,12 @@ export interface SearchTweet {
|
|
|
1518
1572
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
1519
1573
|
>;
|
|
1520
1574
|
|
|
1575
|
+
/**
|
|
1576
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
1577
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
1578
|
+
*/
|
|
1579
|
+
unknownFields?: Array<'text'>;
|
|
1580
|
+
|
|
1521
1581
|
/**
|
|
1522
1582
|
* User IDs that left this conversation.
|
|
1523
1583
|
*/
|
|
@@ -2074,6 +2134,23 @@ export namespace SearchTweet {
|
|
|
2074
2134
|
}
|
|
2075
2135
|
}
|
|
2076
2136
|
|
|
2137
|
+
export interface LiveEventContext {
|
|
2138
|
+
/**
|
|
2139
|
+
* The event's image.
|
|
2140
|
+
*/
|
|
2141
|
+
imageUrl?: string;
|
|
2142
|
+
|
|
2143
|
+
/**
|
|
2144
|
+
* Event name.
|
|
2145
|
+
*/
|
|
2146
|
+
title?: string;
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* The event's page on X.
|
|
2150
|
+
*/
|
|
2151
|
+
url?: string;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2077
2154
|
/**
|
|
2078
2155
|
* Complete Note Tweet content and rich-text metadata.
|
|
2079
2156
|
*/
|
|
@@ -2458,6 +2535,13 @@ export namespace SearchTweet {
|
|
|
2458
2535
|
* Public post & user this reaction references.
|
|
2459
2536
|
*/
|
|
2460
2537
|
export interface ReactionContext {
|
|
2538
|
+
/**
|
|
2539
|
+
* The post this one reacts to, with the same fields. X often sends only its
|
|
2540
|
+
* ID, author & edit history. Then unknownFields lists text, and the flags X
|
|
2541
|
+
* did not send are left out.
|
|
2542
|
+
*/
|
|
2543
|
+
reactedToPost?: { [key: string]: unknown };
|
|
2544
|
+
|
|
2461
2545
|
/**
|
|
2462
2546
|
* Referenced post ID.
|
|
2463
2547
|
*/
|
|
@@ -2793,6 +2877,12 @@ export interface TweetMedia {
|
|
|
2793
2877
|
*/
|
|
2794
2878
|
durationMillis?: number;
|
|
2795
2879
|
|
|
2880
|
+
/**
|
|
2881
|
+
* True when the author edited this media in X's own editor before posting.
|
|
2882
|
+
* Absent when X sends no editor info.
|
|
2883
|
+
*/
|
|
2884
|
+
editedWithNativeEditor?: boolean;
|
|
2885
|
+
|
|
2796
2886
|
/**
|
|
2797
2887
|
* Embeddable status.
|
|
2798
2888
|
*/
|
|
@@ -3359,6 +3449,12 @@ export namespace UserProfile {
|
|
|
3359
3449
|
* Organization affiliation label shown on an X profile.
|
|
3360
3450
|
*/
|
|
3361
3451
|
export interface AffiliatesHighlightedLabel {
|
|
3452
|
+
/**
|
|
3453
|
+
* More labels X shows beside the affiliation, such as an automated account's
|
|
3454
|
+
* owner.
|
|
3455
|
+
*/
|
|
3456
|
+
auxiliaryLabels?: Array<AffiliatesHighlightedLabel.AuxiliaryLabel>;
|
|
3457
|
+
|
|
3362
3458
|
badgeUrl?: string;
|
|
3363
3459
|
|
|
3364
3460
|
description?: string;
|
|
@@ -3377,6 +3473,23 @@ export namespace UserProfile {
|
|
|
3377
3473
|
userLabelType?: string;
|
|
3378
3474
|
}
|
|
3379
3475
|
|
|
3476
|
+
export namespace AffiliatesHighlightedLabel {
|
|
3477
|
+
/**
|
|
3478
|
+
* A label X shows on an X profile beside its affiliation label.
|
|
3479
|
+
*/
|
|
3480
|
+
export interface AuxiliaryLabel {
|
|
3481
|
+
badgeUrl?: string;
|
|
3482
|
+
|
|
3483
|
+
description?: string;
|
|
3484
|
+
|
|
3485
|
+
url?: string;
|
|
3486
|
+
|
|
3487
|
+
userLabelDisplayType?: string;
|
|
3488
|
+
|
|
3489
|
+
userLabelType?: string;
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3380
3493
|
/**
|
|
3381
3494
|
* The parts of the birthday the account made public.
|
|
3382
3495
|
*/
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
import { APIResource } from '../core/resource';
|
|
6
|
+
import * as Shared from './shared';
|
|
6
7
|
import { APIPromise } from '../core/api-promise';
|
|
7
8
|
import { RequestOptions } from '../internal/request-options';
|
|
8
9
|
|
|
@@ -35,9 +36,21 @@ export interface SubscribeCreateResponse {
|
|
|
35
36
|
status: 'checkout_created' | 'already_subscribed' | 'payment_issue';
|
|
36
37
|
|
|
37
38
|
url: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Currency the checkout charges. Only a checkout_created answer has it.
|
|
42
|
+
*/
|
|
43
|
+
chargedCurrency?: Shared.Currency;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
export interface SubscribeCreateParams {
|
|
47
|
+
/**
|
|
48
|
+
* Currency to pay in, USD by default. Lowercase codes work too. Each renewal
|
|
49
|
+
* charges the same amount before tax. chargedCurrency shows the currency
|
|
50
|
+
* charged.
|
|
51
|
+
*/
|
|
52
|
+
currency?: Shared.Currency;
|
|
53
|
+
|
|
41
54
|
/**
|
|
42
55
|
* Subscription tier to pre-select.
|
|
43
56
|
*/
|
package/src/resources/x/index.ts
CHANGED
|
@@ -294,6 +294,7 @@ export {
|
|
|
294
294
|
type SportRetrieveBoxScoreParams,
|
|
295
295
|
type SportRetrievePlaysParams,
|
|
296
296
|
type SportsTeamRecord,
|
|
297
|
+
type SportsTeamGame,
|
|
297
298
|
type SportsGameAudienceViewers,
|
|
298
299
|
type SportsGameAudienceTeamPick,
|
|
299
300
|
type SportsGameAudienceTeamPicks,
|
|
@@ -301,4 +302,13 @@ export {
|
|
|
301
302
|
type SportsGameAudienceChat,
|
|
302
303
|
type SportsGameAudience,
|
|
303
304
|
type SportRetrieveAudienceParams,
|
|
305
|
+
type FootballRosterTeam,
|
|
306
|
+
type FootballRoster,
|
|
307
|
+
type FootballPlayerProp,
|
|
308
|
+
type FootballPropCategory,
|
|
309
|
+
type FootballProps,
|
|
310
|
+
type SportsGamePosts,
|
|
311
|
+
type SportRetrieveRosterParams,
|
|
312
|
+
type SportRetrievePlayerPropsParams,
|
|
313
|
+
type SportListPostsParams,
|
|
304
314
|
} from './sports';
|
package/src/resources/x/media.ts
CHANGED
|
@@ -57,6 +57,11 @@ export interface MediaDownloadResponse {
|
|
|
57
57
|
|
|
58
58
|
galleryUrl?: string;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The post's files saved to your gallery. Single downloads only.
|
|
62
|
+
*/
|
|
63
|
+
items?: Array<MediaDownloadResponse.Item>;
|
|
64
|
+
|
|
60
65
|
totalMedia?: number;
|
|
61
66
|
|
|
62
67
|
totalTweets?: number;
|
|
@@ -64,6 +69,51 @@ export interface MediaDownloadResponse {
|
|
|
64
69
|
tweetId?: string;
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
export namespace MediaDownloadResponse {
|
|
73
|
+
/**
|
|
74
|
+
* 1 file saved to your gallery.
|
|
75
|
+
*/
|
|
76
|
+
export interface Item {
|
|
77
|
+
/**
|
|
78
|
+
* Gallery file ID.
|
|
79
|
+
*/
|
|
80
|
+
id: string;
|
|
81
|
+
|
|
82
|
+
tweetId: string;
|
|
83
|
+
|
|
84
|
+
mediaType: 'photo' | 'video' | 'animated_gif';
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Saved copy of the file.
|
|
88
|
+
*/
|
|
89
|
+
mediaUrl: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* File size in bytes, as a string.
|
|
93
|
+
*/
|
|
94
|
+
fileSize: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* When the file joined your gallery.
|
|
98
|
+
*/
|
|
99
|
+
createdAt: string;
|
|
100
|
+
|
|
101
|
+
authorUsername: string;
|
|
102
|
+
|
|
103
|
+
authorDisplayName: string;
|
|
104
|
+
|
|
105
|
+
authorAvatar: string | null;
|
|
106
|
+
|
|
107
|
+
tweetText: string;
|
|
108
|
+
|
|
109
|
+
likes: number | null;
|
|
110
|
+
|
|
111
|
+
retweets: number | null;
|
|
112
|
+
|
|
113
|
+
views: number | null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
67
117
|
/**
|
|
68
118
|
* Durable write record. Poll statusUrl until terminal is true. Reusing its
|
|
69
119
|
* Idempotency-Key returns this record. Create another action only when safeToRetry
|