x-twitter-scraper 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +1 -1
  4. data/lib/x_twitter_scraper/internal/type/union.rb +25 -9
  5. data/lib/x_twitter_scraper/models/content_disclosure.rb +1 -9
  6. data/lib/x_twitter_scraper/models/embedded_tweet.rb +389 -1
  7. data/lib/x_twitter_scraper/models/paginated_tweets.rb +4 -5
  8. data/lib/x_twitter_scraper/models/search_tweet.rb +371 -1
  9. data/lib/x_twitter_scraper/models/support/ticket_list_response.rb +30 -17
  10. data/lib/x_twitter_scraper/models/support/ticket_retrieve_response.rb +49 -24
  11. data/lib/x_twitter_scraper/models/support/ticket_update_response.rb +18 -6
  12. data/lib/x_twitter_scraper/models/trend_list_response.rb +28 -1
  13. data/lib/x_twitter_scraper/models/tweet_media.rb +213 -1
  14. data/lib/x_twitter_scraper/models/user_profile.rb +211 -21
  15. data/lib/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rb +60 -26
  16. data/lib/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rb +4 -4
  17. data/lib/x_twitter_scraper/models/x/account_create_response.rb +149 -2
  18. data/lib/x_twitter_scraper/models/x/account_reauth_response.rb +4 -4
  19. data/lib/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rb +3 -5
  20. data/lib/x_twitter_scraper/models/x/communities/tweet_list_params.rb +3 -5
  21. data/lib/x_twitter_scraper/models/x/community_retrieve_info_response.rb +1 -17
  22. data/lib/x_twitter_scraper/models/x/community_retrieve_search_params.rb +3 -5
  23. data/lib/x_twitter_scraper/models/x/list_retrieve_tweets_params.rb +3 -5
  24. data/lib/x_twitter_scraper/models/x/tweet_author.rb +14 -1
  25. data/lib/x_twitter_scraper/models/x/tweet_detail.rb +373 -1
  26. data/lib/x_twitter_scraper/models/x/tweet_get_quotes_params.rb +3 -5
  27. data/lib/x_twitter_scraper/models/x/tweet_get_replies_params.rb +34 -6
  28. data/lib/x_twitter_scraper/models/x/tweet_get_replies_response.rb +345 -0
  29. data/lib/x_twitter_scraper/models/x/tweet_get_thread_params.rb +3 -5
  30. data/lib/x_twitter_scraper/models/x/user_retrieve_likes_params.rb +3 -5
  31. data/lib/x_twitter_scraper/models/x/user_retrieve_media_params.rb +3 -5
  32. data/lib/x_twitter_scraper/models/x/user_retrieve_mentions_params.rb +3 -5
  33. data/lib/x_twitter_scraper/models/x/user_retrieve_replies_params.rb +3 -5
  34. data/lib/x_twitter_scraper/models/x/user_retrieve_tweets_params.rb +3 -5
  35. data/lib/x_twitter_scraper/models/x_get_article_response.rb +1 -7
  36. data/lib/x_twitter_scraper/models/x_get_trends_response.rb +28 -1
  37. data/lib/x_twitter_scraper/resources/x/account_connection_attempts.rb +1 -1
  38. data/lib/x_twitter_scraper/resources/x/accounts.rb +2 -2
  39. data/lib/x_twitter_scraper/resources/x/communities/tweets.rb +2 -2
  40. data/lib/x_twitter_scraper/resources/x/communities.rb +1 -1
  41. data/lib/x_twitter_scraper/resources/x/lists.rb +1 -1
  42. data/lib/x_twitter_scraper/resources/x/tweets.rb +14 -11
  43. data/lib/x_twitter_scraper/resources/x/users.rb +5 -5
  44. data/lib/x_twitter_scraper/version.rb +1 -1
  45. data/lib/x_twitter_scraper.rb +2 -1
  46. data/rbi/x_twitter_scraper/models/content_disclosure.rbi +1 -15
  47. data/rbi/x_twitter_scraper/models/embedded_tweet.rbi +708 -3
  48. data/rbi/x_twitter_scraper/models/paginated_tweets.rbi +4 -5
  49. data/rbi/x_twitter_scraper/models/search_tweet.rbi +674 -3
  50. data/rbi/x_twitter_scraper/models/support/ticket_list_response.rbi +75 -55
  51. data/rbi/x_twitter_scraper/models/support/ticket_retrieve_response.rbi +129 -87
  52. data/rbi/x_twitter_scraper/models/support/ticket_update_response.rbi +62 -13
  53. data/rbi/x_twitter_scraper/models/trend_list_response.rbi +40 -3
  54. data/rbi/x_twitter_scraper/models/tweet_media.rbi +313 -3
  55. data/rbi/x_twitter_scraper/models/user_profile.rbi +340 -29
  56. data/rbi/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbi +61 -83
  57. data/rbi/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbi +6 -6
  58. data/rbi/x_twitter_scraper/models/x/account_create_response.rbi +264 -2
  59. data/rbi/x_twitter_scraper/models/x/account_reauth_response.rbi +6 -6
  60. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_by_community_params.rbi +4 -8
  61. data/rbi/x_twitter_scraper/models/x/communities/tweet_list_params.rbi +4 -8
  62. data/rbi/x_twitter_scraper/models/x/community_retrieve_info_response.rbi +0 -22
  63. data/rbi/x_twitter_scraper/models/x/community_retrieve_search_params.rbi +4 -8
  64. data/rbi/x_twitter_scraper/models/x/list_retrieve_tweets_params.rbi +4 -8
  65. data/rbi/x_twitter_scraper/models/x/tweet_author.rbi +13 -3
  66. data/rbi/x_twitter_scraper/models/x/tweet_detail.rbi +690 -3
  67. data/rbi/x_twitter_scraper/models/x/tweet_get_quotes_params.rbi +4 -8
  68. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_params.rbi +68 -8
  69. data/rbi/x_twitter_scraper/models/x/tweet_get_replies_response.rbi +527 -0
  70. data/rbi/x_twitter_scraper/models/x/tweet_get_thread_params.rbi +4 -8
  71. data/rbi/x_twitter_scraper/models/x/user_retrieve_likes_params.rbi +4 -8
  72. data/rbi/x_twitter_scraper/models/x/user_retrieve_media_params.rbi +4 -8
  73. data/rbi/x_twitter_scraper/models/x/user_retrieve_mentions_params.rbi +4 -8
  74. data/rbi/x_twitter_scraper/models/x/user_retrieve_replies_params.rbi +4 -8
  75. data/rbi/x_twitter_scraper/models/x/user_retrieve_tweets_params.rbi +4 -8
  76. data/rbi/x_twitter_scraper/models/x_get_article_response.rbi +0 -9
  77. data/rbi/x_twitter_scraper/models/x_get_trends_response.rbi +40 -3
  78. data/rbi/x_twitter_scraper/resources/x/accounts.rbi +1 -1
  79. data/rbi/x_twitter_scraper/resources/x/communities/tweets.rbi +4 -8
  80. data/rbi/x_twitter_scraper/resources/x/communities.rbi +2 -4
  81. data/rbi/x_twitter_scraper/resources/x/lists.rbi +2 -4
  82. data/rbi/x_twitter_scraper/resources/x/tweets.rbi +20 -18
  83. data/rbi/x_twitter_scraper/resources/x/users.rbi +10 -20
  84. data/sig/x_twitter_scraper/models/content_disclosure.rbs +1 -11
  85. data/sig/x_twitter_scraper/models/embedded_tweet.rbs +343 -62
  86. data/sig/x_twitter_scraper/models/search_tweet.rbs +333 -70
  87. data/sig/x_twitter_scraper/models/support/ticket_list_response.rbs +29 -32
  88. data/sig/x_twitter_scraper/models/support/ticket_retrieve_response.rbs +49 -48
  89. data/sig/x_twitter_scraper/models/support/ticket_update_response.rbs +25 -7
  90. data/sig/x_twitter_scraper/models/trend_list_response.rbs +16 -20
  91. data/sig/x_twitter_scraper/models/tweet_media.rbs +146 -15
  92. data/sig/x_twitter_scraper/models/user_profile.rbs +164 -86
  93. data/sig/x_twitter_scraper/models/x/account_connection_attempt_retrieve_response.rbs +50 -33
  94. data/sig/x_twitter_scraper/models/x/account_connection_challenge_submit_response.rbs +5 -5
  95. data/sig/x_twitter_scraper/models/x/account_create_response.rbs +147 -1
  96. data/sig/x_twitter_scraper/models/x/account_reauth_response.rbs +5 -5
  97. data/sig/x_twitter_scraper/models/x/community_retrieve_info_response.rbs +0 -14
  98. data/sig/x_twitter_scraper/models/x/tweet_author.rbs +11 -3
  99. data/sig/x_twitter_scraper/models/x/tweet_detail.rbs +333 -70
  100. data/sig/x_twitter_scraper/models/x/tweet_get_replies_params.rbs +26 -0
  101. data/sig/x_twitter_scraper/models/x/tweet_get_replies_response.rbs +274 -0
  102. data/sig/x_twitter_scraper/models/x_get_article_response.rbs +0 -7
  103. data/sig/x_twitter_scraper/models/x_get_trends_response.rbs +25 -3
  104. data/sig/x_twitter_scraper/resources/x/accounts.rbs +1 -1
  105. data/sig/x_twitter_scraper/resources/x/tweets.rbs +3 -1
  106. metadata +4 -1
@@ -5,7 +5,153 @@
5
5
  module XTwitterScraper
6
6
  module Models
7
7
  module X
8
- AccountCreateResponse: XTwitterScraper::Internal::Type::Converter
8
+ type account_create_response =
9
+ XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount
10
+ | XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionAttemptPending
11
+ | XTwitterScraper::Models::X::AccountCreateResponse::XAccountConnectionChallenge
12
+
13
+ module AccountCreateResponse
14
+ extend XTwitterScraper::Internal::Type::Union
15
+
16
+ type sanitized_x_account =
17
+ {
18
+ id: String,
19
+ created_at: Time,
20
+ health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health,
21
+ status: :active,
22
+ x_user_id: String,
23
+ x_username: String
24
+ }
25
+
26
+ class SanitizedXAccount < XTwitterScraper::Internal::Type::BaseModel
27
+ attr_accessor id: String
28
+
29
+ attr_accessor created_at: Time
30
+
31
+ attr_accessor health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health
32
+
33
+ attr_accessor status: :active
34
+
35
+ attr_accessor x_user_id: String
36
+
37
+ attr_accessor x_username: String
38
+
39
+ def initialize: (
40
+ id: String,
41
+ created_at: Time,
42
+ health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health,
43
+ x_user_id: String,
44
+ x_username: String,
45
+ ?status: :active
46
+ ) -> void
47
+
48
+ def to_hash: -> {
49
+ id: String,
50
+ created_at: Time,
51
+ health: XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health,
52
+ status: :active,
53
+ x_user_id: String,
54
+ x_username: String
55
+ }
56
+
57
+ type health =
58
+ :healthy
59
+ | :locked
60
+ | :needsReauth
61
+ | :recovering
62
+ | :suspended
63
+ | :temporaryIssue
64
+
65
+ module Health
66
+ extend XTwitterScraper::Internal::Type::Enum
67
+
68
+ HEALTHY: :healthy
69
+ LOCKED: :locked
70
+ NEEDS_REAUTH: :needsReauth
71
+ RECOVERING: :recovering
72
+ SUSPENDED: :suspended
73
+ TEMPORARY_ISSUE: :temporaryIssue
74
+
75
+ def self?.values: -> ::Array[XTwitterScraper::Models::X::AccountCreateResponse::SanitizedXAccount::health]
76
+ end
77
+ end
78
+
79
+ type x_account_connection_attempt_pending =
80
+ {
81
+ id: String,
82
+ object: :x_account_connection_attempt,
83
+ poll_after_ms: Integer,
84
+ status: :pending
85
+ }
86
+
87
+ class XAccountConnectionAttemptPending < XTwitterScraper::Internal::Type::BaseModel
88
+ attr_accessor id: String
89
+
90
+ attr_accessor object: :x_account_connection_attempt
91
+
92
+ attr_accessor poll_after_ms: Integer
93
+
94
+ attr_accessor status: :pending
95
+
96
+ def initialize: (
97
+ id: String,
98
+ poll_after_ms: Integer,
99
+ ?object: :x_account_connection_attempt,
100
+ ?status: :pending
101
+ ) -> void
102
+
103
+ def to_hash: -> {
104
+ id: String,
105
+ object: :x_account_connection_attempt,
106
+ poll_after_ms: Integer,
107
+ status: :pending
108
+ }
109
+ end
110
+
111
+ type x_account_connection_challenge =
112
+ {
113
+ id: String,
114
+ expires_at: Time,
115
+ message: String,
116
+ object: :x_account_connection_challenge,
117
+ status: :requires_email_code,
118
+ username: String
119
+ }
120
+
121
+ class XAccountConnectionChallenge < XTwitterScraper::Internal::Type::BaseModel
122
+ attr_accessor id: String
123
+
124
+ attr_accessor expires_at: Time
125
+
126
+ attr_accessor message: String
127
+
128
+ attr_accessor object: :x_account_connection_challenge
129
+
130
+ attr_accessor status: :requires_email_code
131
+
132
+ attr_accessor username: String
133
+
134
+ def initialize: (
135
+ id: String,
136
+ expires_at: Time,
137
+ message: String,
138
+ username: String,
139
+ ?object: :x_account_connection_challenge,
140
+ ?status: :requires_email_code
141
+ ) -> void
142
+
143
+ def to_hash: -> {
144
+ id: String,
145
+ expires_at: Time,
146
+ message: String,
147
+ object: :x_account_connection_challenge,
148
+ status: :requires_email_code,
149
+ username: String
150
+ }
151
+ end
152
+
153
+ def self?.variants: -> ::Array[XTwitterScraper::Models::X::account_create_response]
154
+ end
9
155
  end
10
156
  end
11
157
  end
@@ -10,7 +10,7 @@ module XTwitterScraper
10
10
  id: String,
11
11
  created_at: Time,
12
12
  health: XTwitterScraper::Models::X::AccountReauthResponse::health,
13
- status: String,
13
+ status: :active,
14
14
  x_user_id: String,
15
15
  x_username: String
16
16
  }
@@ -22,7 +22,7 @@ module XTwitterScraper
22
22
 
23
23
  attr_accessor health: XTwitterScraper::Models::X::AccountReauthResponse::health
24
24
 
25
- attr_accessor status: String
25
+ attr_accessor status: :active
26
26
 
27
27
  attr_accessor x_user_id: String
28
28
 
@@ -32,16 +32,16 @@ module XTwitterScraper
32
32
  id: String,
33
33
  created_at: Time,
34
34
  health: XTwitterScraper::Models::X::AccountReauthResponse::health,
35
- status: String,
36
35
  x_user_id: String,
37
- x_username: String
36
+ x_username: String,
37
+ ?status: :active
38
38
  ) -> void
39
39
 
40
40
  def to_hash: -> {
41
41
  id: String,
42
42
  created_at: Time,
43
43
  health: XTwitterScraper::Models::X::AccountReauthResponse::health,
44
- status: String,
44
+ status: :active,
45
45
  x_user_id: String,
46
46
  x_username: String
47
47
  }
@@ -29,14 +29,12 @@ module XTwitterScraper
29
29
  creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator,
30
30
  description: String,
31
31
  invites_policy: String,
32
- is_member: bool,
33
32
  is_nsfw: bool,
34
33
  join_policy: String,
35
34
  member_count: Integer,
36
35
  moderator_count: Integer,
37
36
  name: String,
38
37
  primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic,
39
- role: String,
40
38
  rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]
41
39
  }
42
40
 
@@ -65,10 +63,6 @@ module XTwitterScraper
65
63
 
66
64
  def invites_policy=: (String) -> String
67
65
 
68
- attr_reader is_member: bool?
69
-
70
- def is_member=: (bool) -> bool
71
-
72
66
  attr_reader is_nsfw: bool?
73
67
 
74
68
  def is_nsfw=: (bool) -> bool
@@ -95,10 +89,6 @@ module XTwitterScraper
95
89
  XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic
96
90
  ) -> XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic
97
91
 
98
- attr_reader role: String?
99
-
100
- def role=: (String) -> String
101
-
102
92
  attr_reader rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]?
103
93
 
104
94
  def rules=: (
@@ -112,14 +102,12 @@ module XTwitterScraper
112
102
  ?creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator,
113
103
  ?description: String,
114
104
  ?invites_policy: String,
115
- ?is_member: bool,
116
105
  ?is_nsfw: bool,
117
106
  ?join_policy: String,
118
107
  ?member_count: Integer,
119
108
  ?moderator_count: Integer,
120
109
  ?name: String,
121
110
  ?primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic,
122
- ?role: String,
123
111
  ?rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]
124
112
  ) -> void
125
113
 
@@ -130,14 +118,12 @@ module XTwitterScraper
130
118
  creator: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Creator,
131
119
  description: String,
132
120
  invites_policy: String,
133
- is_member: bool,
134
121
  is_nsfw: bool,
135
122
  join_policy: String,
136
123
  member_count: Integer,
137
124
  moderator_count: Integer,
138
125
  name: String,
139
126
  primary_topic: XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::PrimaryTopic,
140
- role: String,
141
127
  rules: ::Array[XTwitterScraper::Models::X::CommunityRetrieveInfoResponse::Community::Rule]
142
128
  }
143
129
 
@@ -5,12 +5,20 @@
5
5
  module XTwitterScraper
6
6
  module Models
7
7
  module X
8
- type tweet_author = { }
8
+ type tweet_author = ::Hash[Symbol, top]
9
9
 
10
10
  class TweetAuthor < XTwitterScraper::Models::UserProfile
11
- def initialize: -> void
11
+ def followers: -> Integer
12
12
 
13
- def to_hash: -> { }
13
+ def followers=: (Integer _) -> Integer
14
+
15
+ def verified: -> bool
16
+
17
+ def verified=: (bool _) -> bool
18
+
19
+ def initialize: (**untyped) -> void
20
+
21
+ def to_hash: -> ::Hash[Symbol, top]
14
22
  end
15
23
  end
16
24
  end