x-twitter-scraper 0.10.1 → 0.10.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 +8 -0
- data/README.md +65 -77
- data/SECURITY.md +2 -2
- data/lib/x_twitter_scraper/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2eed85b02b44c9bcefbbec637c0063d3f95038d8951f30108ad4ab3853a60335
|
|
4
|
+
data.tar.gz: 3b26cbff158153d925e414d3b8fea75ae087b49d96014125a96c2c7e7b9a7667
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b0f8c7ba5e866d08cb7fcf488481639e4026b08ae56e9a47e8b5919ad6be2f88b09485b9783b310aab837e7faa9aa07d2b12d3ebcbf22d7df2bca20ce2bde80
|
|
7
|
+
data.tar.gz: 2d0eda060f2b3e5433951ab27fe1b12c48ffb083b989a53c8944edb68e31ae4ce0d39cdcd682b0aad76205441fc7cb35147a4398ce6ccb93e729de655d1c22af
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.2 (2026-08-20)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.10.1...v0.10.2](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.10.1...v0.10.2)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
* refine public Ruby SDK text ([#49](https://github.com/Xquik-dev/x-twitter-scraper-ruby/issues/49)) ([3d79615](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/3d79615cf4c1acc0ec8a6272d684302fe43e60dc))
|
|
10
|
+
|
|
3
11
|
## 0.10.1 (2026-08-18)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.10.0...v0.10.1](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.10.0...v0.10.1)
|
data/README.md
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Xquik Ruby SDK: Twitter Search, Followers & X Automation
|
|
2
2
|
|
|
3
3
|
[](https://www.bestpractices.dev/projects/13739)
|
|
4
4
|
|
|
5
|
-
Use Xquik
|
|
5
|
+
Use the Xquik Ruby SDK for Twitter search, timelines, profiles & followers. Manage media, webhooks & X automation with typed request objects. It provides a Twitter API alternative through documented Xquik REST routes.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Read the [Ruby SDK guide](https://docs.xquik.com/sdks/ruby), [API guide](https://docs.xquik.com/api-reference/overview), or [RubyDoc reference](https://gemdocs.org/gems/x-twitter-scraper).
|
|
7
|
+
[Ruby SDK Guide](https://docs.xquik.com/sdks/ruby) | [REST API](https://docs.xquik.com/api-reference/overview) | [RubyDoc](https://gemdocs.org/gems/x-twitter-scraper) | [Webhooks](https://docs.xquik.com/api-reference/webhooks/create)
|
|
10
8
|
|
|
11
9
|
## Choose the Ruby SDK
|
|
12
10
|
|
|
13
|
-
Choose this gem for Ruby services
|
|
14
|
-
Reuse one client for connection pooling in threaded applications.
|
|
15
|
-
Use the SDK guide for generated method names.
|
|
11
|
+
Choose this gem for Ruby services that use Sorbet or RBS. Reuse one client for pooled connections.
|
|
16
12
|
|
|
17
|
-
## Common X
|
|
13
|
+
## Common Twitter & X Tasks
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
Map each task to its REST route.
|
|
20
16
|
|
|
21
|
-
|
|
|
17
|
+
| Task | REST Route | Usage |
|
|
22
18
|
| --- | --- | --- |
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
19
|
+
| Search tweets without the X API | `GET /x/tweets/search` | Use keyword or advanced operator queries. |
|
|
20
|
+
| Read an X profile timeline | `GET /x/users/{id}/tweets` | Paginate bounded results. |
|
|
21
|
+
| Scrape Twitter followers | `GET /x/users/{id}/followers` | Use an extraction for complete datasets. |
|
|
22
|
+
| Scrape following accounts | `GET /x/users/{id}/following` | Use an extraction for complete datasets. |
|
|
23
|
+
| Read a home timeline | `GET /x/timeline` | Approve this private read. |
|
|
24
|
+
| Export large X datasets | `POST /extractions` | Poll status, then download results. |
|
|
25
|
+
| Download or upload media | `/x/media/*` | Use typed file helpers. |
|
|
26
|
+
| Monitor an account | `POST /monitors` | Deliver events through HMAC webhooks. |
|
|
27
|
+
| Post or reply | `POST /x/tweets` | Confirm the account and payload. |
|
|
30
28
|
|
|
31
29
|
## Installation
|
|
32
30
|
|
|
@@ -35,7 +33,7 @@ Add the gem to your `Gemfile`:
|
|
|
35
33
|
<!-- x-release-please-start-version -->
|
|
36
34
|
|
|
37
35
|
```ruby
|
|
38
|
-
gem "x-twitter-scraper", "~> 0.10.
|
|
36
|
+
gem "x-twitter-scraper", "~> 0.10.2"
|
|
39
37
|
```
|
|
40
38
|
|
|
41
39
|
<!-- x-release-please-end -->
|
|
@@ -55,25 +53,25 @@ response = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10)
|
|
|
55
53
|
puts(response)
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
### Handling
|
|
56
|
+
### Handling Errors
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
The SDK raises an `APIError` subclass for connection failures and non-2xx responses:
|
|
61
59
|
|
|
62
60
|
```ruby
|
|
63
61
|
begin
|
|
64
62
|
account = x_twitter_scraper.account.retrieve
|
|
65
63
|
rescue XTwitterScraper::Errors::APIConnectionError => e
|
|
66
|
-
puts("
|
|
67
|
-
puts(e.cause) #
|
|
64
|
+
puts("Could not reach the server. Check the connection.")
|
|
65
|
+
puts(e.cause) # Underlying net/http exception.
|
|
68
66
|
rescue XTwitterScraper::Errors::RateLimitError => e
|
|
69
|
-
puts("
|
|
67
|
+
puts("Rate limited. Retry later.")
|
|
70
68
|
rescue XTwitterScraper::Errors::APIStatusError => e
|
|
71
|
-
puts("
|
|
69
|
+
puts("The server returned another non-2xx status.")
|
|
72
70
|
puts(e.status)
|
|
73
71
|
end
|
|
74
72
|
```
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
The SDK uses these error classes:
|
|
77
75
|
|
|
78
76
|
| Cause | Error Type |
|
|
79
77
|
| ---------------- | -------------------------- |
|
|
@@ -91,61 +89,58 @@ Error codes are as follows:
|
|
|
91
89
|
|
|
92
90
|
### Retries
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
You can use the `max_retries` option to configure or disable this:
|
|
92
|
+
The SDK retries connection errors, timeouts, and HTTP 408, 409, 429, and 5xx responses.
|
|
93
|
+
It uses exponential backoff and attempts 2 retries by default.
|
|
94
|
+
Set `max_retries` to change or disable retries:
|
|
99
95
|
|
|
100
96
|
```ruby
|
|
101
|
-
#
|
|
97
|
+
# Set the client default:
|
|
102
98
|
x_twitter_scraper = XTwitterScraper::Client.new(
|
|
103
99
|
max_retries: 0 # default is 2
|
|
104
100
|
)
|
|
105
101
|
|
|
106
|
-
#
|
|
102
|
+
# Override one request:
|
|
107
103
|
x_twitter_scraper.account.retrieve(request_options: {max_retries: 5})
|
|
108
104
|
```
|
|
109
105
|
|
|
110
106
|
### Timeouts
|
|
111
107
|
|
|
112
|
-
|
|
108
|
+
Requests time out after 60 seconds. Set `timeout` to change or disable this limit:
|
|
113
109
|
|
|
114
110
|
```ruby
|
|
115
|
-
#
|
|
111
|
+
# Set the client default:
|
|
116
112
|
x_twitter_scraper = XTwitterScraper::Client.new(
|
|
117
113
|
timeout: nil # default is 60
|
|
118
114
|
)
|
|
119
115
|
|
|
120
|
-
#
|
|
116
|
+
# Override one request:
|
|
121
117
|
x_twitter_scraper.account.retrieve(request_options: {timeout: 5})
|
|
122
118
|
```
|
|
123
119
|
|
|
124
120
|
On timeout, `XTwitterScraper::Errors::APITimeoutError` is raised.
|
|
125
121
|
|
|
126
|
-
|
|
122
|
+
Timed-out requests follow the default retry policy.
|
|
127
123
|
|
|
128
|
-
## Advanced
|
|
124
|
+
## Advanced Concepts
|
|
129
125
|
|
|
130
126
|
### BaseModel
|
|
131
127
|
|
|
132
|
-
All parameter and response objects inherit from `XTwitterScraper::Internal::Type::BaseModel
|
|
133
|
-
|
|
134
|
-
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
|
|
128
|
+
All parameter and response objects inherit from `XTwitterScraper::Internal::Type::BaseModel`.
|
|
129
|
+
The base model provides these operations:
|
|
135
130
|
|
|
136
|
-
|
|
131
|
+
1. Access known and unknown fields with `obj[:prop]`.
|
|
132
|
+
2. Destructure fields with `obj => {prop: prop}` or pattern matching.
|
|
133
|
+
3. Compare objects by their field values with `==`.
|
|
134
|
+
4. Print classes and instances in a readable format.
|
|
135
|
+
5. Convert values with `#to_h`, `#deep_to_h`, `#to_json`, or `#to_yaml`.
|
|
137
136
|
|
|
138
|
-
|
|
137
|
+
### Making Custom or Undocumented Requests
|
|
139
138
|
|
|
140
|
-
|
|
139
|
+
#### Undocumented Properties
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
Send undocumented parameters and read undocumented response properties:
|
|
143
142
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
You can send undocumented parameters to any endpoint, and read undocumented response properties, like so:
|
|
147
|
-
|
|
148
|
-
Note: the `extra_` parameters of the same name overrides the documented parameters.
|
|
143
|
+
A matching `extra_` option overrides its documented parameter.
|
|
149
144
|
|
|
150
145
|
```ruby
|
|
151
146
|
account =
|
|
@@ -160,13 +155,13 @@ account =
|
|
|
160
155
|
puts(account[:my_undocumented_property])
|
|
161
156
|
```
|
|
162
157
|
|
|
163
|
-
#### Undocumented
|
|
158
|
+
#### Undocumented Request Parameters
|
|
164
159
|
|
|
165
|
-
|
|
160
|
+
Pass extra values through `extra_query`, `extra_body`, or `extra_headers` under `request_options:`.
|
|
166
161
|
|
|
167
|
-
#### Undocumented
|
|
162
|
+
#### Undocumented Endpoints
|
|
168
163
|
|
|
169
|
-
|
|
164
|
+
Use `client.request` for undocumented endpoints while retaining authentication and retries:
|
|
170
165
|
|
|
171
166
|
```ruby
|
|
172
167
|
response = client.request(
|
|
@@ -178,40 +173,33 @@ response = client.request(
|
|
|
178
173
|
)
|
|
179
174
|
```
|
|
180
175
|
|
|
181
|
-
### Concurrency &
|
|
182
|
-
|
|
183
|
-
The `XTwitterScraper::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
|
|
176
|
+
### Concurrency & Connection Pooling
|
|
184
177
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
178
|
+
Clients are thread-safe. Fork them only when no HTTP requests are in flight.
|
|
179
|
+
Each client has an HTTP connection pool with a default size of 99.
|
|
180
|
+
Reuse one client per application in most cases.
|
|
181
|
+
Requests wait when every connection is busy. This wait counts toward the request timeout.
|
|
182
|
+
Other SDK classes do not lock their data.
|
|
190
183
|
|
|
191
184
|
## Sorbet
|
|
192
185
|
|
|
193
186
|
The SDK includes [RBI](https://sorbet.org/docs/rbi) definitions. It does not depend on `sorbet-runtime`.
|
|
194
187
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
```ruby
|
|
198
|
-
x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10)
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
Or, equivalently:
|
|
188
|
+
Pass request hashes or typed parameter objects:
|
|
202
189
|
|
|
203
190
|
```ruby
|
|
204
|
-
# Hashes work
|
|
191
|
+
# Hashes work without type safety:
|
|
205
192
|
x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10)
|
|
206
193
|
|
|
207
|
-
#
|
|
194
|
+
# Splat a complete Params object:
|
|
208
195
|
params = XTwitterScraper::X::TweetSearchParams.new(q: "from:elonmusk", limit: 10)
|
|
209
196
|
x_twitter_scraper.x.tweets.search(**params)
|
|
210
197
|
```
|
|
211
198
|
|
|
212
199
|
### Enums
|
|
213
200
|
|
|
214
|
-
|
|
201
|
+
The SDK does not depend on `sorbet-runtime` or provide [`T::Enum`](https://sorbet.org/docs/tenum) instances.
|
|
202
|
+
It uses tagged symbols, which remain primitives at runtime:
|
|
215
203
|
|
|
216
204
|
```ruby
|
|
217
205
|
# :en
|
|
@@ -221,16 +209,16 @@ puts(XTwitterScraper::AccountUpdateLocaleParams::Locale::EN)
|
|
|
221
209
|
T.reveal_type(XTwitterScraper::AccountUpdateLocaleParams::Locale::EN)
|
|
222
210
|
```
|
|
223
211
|
|
|
224
|
-
Enum parameters
|
|
212
|
+
Enum parameters accept constants or literal values:
|
|
225
213
|
|
|
226
214
|
```ruby
|
|
227
|
-
#
|
|
215
|
+
# Enum constants preserve tagged type information:
|
|
228
216
|
x_twitter_scraper.account.update_locale(
|
|
229
217
|
locale: XTwitterScraper::AccountUpdateLocaleParams::Locale::EN,
|
|
230
218
|
# …
|
|
231
219
|
)
|
|
232
220
|
|
|
233
|
-
# Literal values
|
|
221
|
+
# Literal values also work:
|
|
234
222
|
x_twitter_scraper.account.update_locale(
|
|
235
223
|
locale: :en,
|
|
236
224
|
# …
|
|
@@ -239,9 +227,9 @@ x_twitter_scraper.account.update_locale(
|
|
|
239
227
|
|
|
240
228
|
## Versioning
|
|
241
229
|
|
|
242
|
-
This package follows [SemVer](https://semver.org/spec/v2.0.0.html)
|
|
230
|
+
This package follows [SemVer](https://semver.org/spec/v2.0.0.html). Version `0` releases may change APIs.
|
|
243
231
|
|
|
244
|
-
|
|
232
|
+
Changes to non-runtime `*.rbi` and `*.rbs` definitions remain non-breaking.
|
|
245
233
|
|
|
246
234
|
## Requirements
|
|
247
235
|
|
data/SECURITY.md
CHANGED
|
@@ -12,8 +12,8 @@ Report vulnerabilities privately through
|
|
|
12
12
|
Do not open public issues for secrets, credential handling defects, private
|
|
13
13
|
data exposure, or package supply-chain concerns.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
disclosure
|
|
15
|
+
Maintainers acknowledge reports within 3 business days.
|
|
16
|
+
We coordinate disclosure after confirming the issue.
|
|
17
17
|
|
|
18
18
|
## Scope
|
|
19
19
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: x-twitter-scraper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Xquik
|
|
@@ -972,5 +972,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
972
972
|
requirements: []
|
|
973
973
|
rubygems_version: 4.0.16
|
|
974
974
|
specification_version: 4
|
|
975
|
-
summary: Ruby SDK for
|
|
975
|
+
summary: Ruby SDK for Twitter search, followers, webhooks & X automation. Not affiliated
|
|
976
|
+
with X Corp.
|
|
976
977
|
test_files: []
|