x-twitter-scraper 0.10.3 → 0.10.4
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 -2
- data/README.md +19 -29
- data/SECURITY.md +3 -3
- data/lib/x_twitter_scraper/internal/type/base_model.rb +2 -2
- data/lib/x_twitter_scraper/internal/type/enum.rb +1 -2
- data/lib/x_twitter_scraper/request_options.rb +2 -4
- data/lib/x_twitter_scraper/version.rb +1 -1
- data/rbi/x_twitter_scraper/request_options.rbi +2 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f4f7490097e2a6d503e322f7cc58ad97ee1969eb5d63630b51cabba1e1475fa
|
|
4
|
+
data.tar.gz: e4d5168613a265fda0cf590313d0f636dad69fdde68cf01a62b117bc74669830
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25f7299ef958d3305df6f392af953a70b87aa1ae639486a90416e49c84fe27faaddd6472f4ba42349c6daf71353143f5a54026904321be69c115abbf63e93fdd
|
|
7
|
+
data.tar.gz: b34e28eba91790af3eb1e585156557ffd631fefd835cc9b1d84b5a8a35e7b81c7b78a8e1a0d7bcbc08e5db872ec2295b1866fede239f4a634d5005450fd09d43
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.4 (2026-08-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.10.3...v0.10.4](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.10.3...v0.10.4)
|
|
6
|
+
|
|
7
|
+
### Documentation
|
|
8
|
+
|
|
9
|
+
* Remove repeated SDK copy and repair public links.
|
|
10
|
+
|
|
3
11
|
## 0.10.3 (2026-08-21)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.10.2...v0.10.3](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.10.2...v0.10.3)
|
|
@@ -273,8 +281,6 @@ Full Changelog: [v0.1.0...v0.2.0](https://github.com/Xquik-dev/x-twitter-scraper
|
|
|
273
281
|
|
|
274
282
|
## 0.1.0 (2026-03-30)
|
|
275
283
|
|
|
276
|
-
Full Changelog: [v0.0.1...v0.1.0](https://github.com/Xquik-dev/x-twitter-scraper-ruby/compare/v0.0.1...v0.1.0)
|
|
277
|
-
|
|
278
284
|
### Features
|
|
279
285
|
|
|
280
286
|
* **api:** api update ([772ffdd](https://github.com/Xquik-dev/x-twitter-scraper-ruby/commit/772ffdd682ee96f94334441b9fc5b1e109559993))
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Xquik Ruby SDK: Twitter
|
|
1
|
+
# Xquik Ruby SDK: Twitter search, followers & X automation
|
|
2
2
|
|
|
3
3
|
[](https://www.bestpractices.dev/projects/13739)
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ Use documented Xquik REST routes as a Twitter API alternative.
|
|
|
8
8
|
|
|
9
9
|
[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
10
|
|
|
11
|
-
## Common Twitter & X
|
|
11
|
+
## Common Twitter & X tasks
|
|
12
12
|
|
|
13
13
|
| Task | REST Route | Usage |
|
|
14
14
|
| --- | --- | --- |
|
|
@@ -24,12 +24,14 @@ Use documented Xquik REST routes as a Twitter API alternative.
|
|
|
24
24
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
|
+
Requires Ruby 3.2.0 or higher.
|
|
28
|
+
|
|
27
29
|
Add the gem to your `Gemfile`:
|
|
28
30
|
|
|
29
31
|
<!-- x-release-please-start-version -->
|
|
30
32
|
|
|
31
33
|
```ruby
|
|
32
|
-
gem "x-twitter-scraper", "~> 0.10.
|
|
34
|
+
gem "x-twitter-scraper", "~> 0.10.4"
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
<!-- x-release-please-end -->
|
|
@@ -41,7 +43,7 @@ require "bundler/setup"
|
|
|
41
43
|
require "x_twitter_scraper"
|
|
42
44
|
|
|
43
45
|
x_twitter_scraper = XTwitterScraper::Client.new(
|
|
44
|
-
api_key: ENV["X_TWITTER_SCRAPER_API_KEY"] #
|
|
46
|
+
api_key: ENV["X_TWITTER_SCRAPER_API_KEY"] # Optional; the client reads this variable.
|
|
45
47
|
)
|
|
46
48
|
|
|
47
49
|
response = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10)
|
|
@@ -49,7 +51,7 @@ response = x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10)
|
|
|
49
51
|
puts(response)
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
### Handling
|
|
54
|
+
### Handling errors
|
|
53
55
|
|
|
54
56
|
The SDK raises an `APIError` subclass for connection failures and non-2xx responses:
|
|
55
57
|
|
|
@@ -67,8 +69,6 @@ rescue XTwitterScraper::Errors::APIStatusError => e
|
|
|
67
69
|
end
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
The SDK uses these error classes:
|
|
71
|
-
|
|
72
72
|
| Cause | Error Type |
|
|
73
73
|
| ---------------- | -------------------------- |
|
|
74
74
|
| HTTP 400 | `BadRequestError` |
|
|
@@ -90,12 +90,12 @@ It uses exponential backoff with 2 retries by default.
|
|
|
90
90
|
Set `max_retries` to change or disable retries:
|
|
91
91
|
|
|
92
92
|
```ruby
|
|
93
|
-
#
|
|
93
|
+
# Change the client default.
|
|
94
94
|
x_twitter_scraper = XTwitterScraper::Client.new(
|
|
95
|
-
max_retries: 0
|
|
95
|
+
max_retries: 0
|
|
96
96
|
)
|
|
97
97
|
|
|
98
|
-
# Override one request
|
|
98
|
+
# Override one request.
|
|
99
99
|
x_twitter_scraper.account.retrieve(request_options: {max_retries: 5})
|
|
100
100
|
```
|
|
101
101
|
|
|
@@ -104,23 +104,20 @@ x_twitter_scraper.account.retrieve(request_options: {max_retries: 5})
|
|
|
104
104
|
Requests time out after 60 seconds. Set `timeout` to change or disable this limit:
|
|
105
105
|
|
|
106
106
|
```ruby
|
|
107
|
-
#
|
|
107
|
+
# Change the client default.
|
|
108
108
|
x_twitter_scraper = XTwitterScraper::Client.new(
|
|
109
|
-
timeout: nil
|
|
109
|
+
timeout: nil
|
|
110
110
|
)
|
|
111
111
|
|
|
112
|
-
# Override one request
|
|
112
|
+
# Override one request.
|
|
113
113
|
x_twitter_scraper.account.retrieve(request_options: {timeout: 5})
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Timeouts raise `XTwitterScraper::Errors::APITimeoutError` and follow the retry policy.
|
|
117
117
|
|
|
118
|
-
##
|
|
118
|
+
## BaseModel
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
All parameter and response objects inherit from `XTwitterScraper::Internal::Type::BaseModel`.
|
|
123
|
-
The base model provides these operations:
|
|
120
|
+
All parameter and response objects inherit from `XTwitterScraper::Internal::Type::BaseModel` and support:
|
|
124
121
|
|
|
125
122
|
1. Access known and unknown fields with `obj[:prop]`.
|
|
126
123
|
2. Destructure fields with `obj => {prop: prop}` or pattern matching.
|
|
@@ -128,7 +125,7 @@ The base model provides these operations:
|
|
|
128
125
|
4. Print classes and instances in a readable format.
|
|
129
126
|
5. Convert values with `#to_h`, `#deep_to_h`, `#to_json`, or `#to_yaml`.
|
|
130
127
|
|
|
131
|
-
|
|
128
|
+
## Custom requests
|
|
132
129
|
|
|
133
130
|
Use `extra_query`, `extra_body`, or `extra_headers` under `request_options`.
|
|
134
131
|
Matching `extra_` values override documented parameters.
|
|
@@ -158,7 +155,7 @@ response = client.request(
|
|
|
158
155
|
)
|
|
159
156
|
```
|
|
160
157
|
|
|
161
|
-
|
|
158
|
+
## Concurrency & connection pooling
|
|
162
159
|
|
|
163
160
|
Clients are thread-safe. Fork them only when no HTTP requests are in flight.
|
|
164
161
|
Each client has an HTTP connection pool with a default size of 99.
|
|
@@ -215,17 +212,10 @@ This package follows [SemVer](https://semver.org/spec/v2.0.0.html). Version `0`
|
|
|
215
212
|
|
|
216
213
|
Changes to non-runtime `*.rbi` and `*.rbs` definitions remain non-breaking.
|
|
217
214
|
|
|
218
|
-
##
|
|
219
|
-
|
|
220
|
-
Ruby 3.2.0 or higher.
|
|
221
|
-
|
|
222
|
-
## Security & Support
|
|
215
|
+
## Help & contributing
|
|
223
216
|
|
|
224
217
|
- Report vulnerabilities through the [security policy](SECURITY.md).
|
|
225
218
|
- Ask usage questions through the [organization support policy](https://github.com/Xquik-dev/.github/blob/main/SUPPORT.md).
|
|
226
|
-
|
|
227
|
-
## Contributing
|
|
228
|
-
|
|
229
|
-
Read the [contribution guide](CONTRIBUTING.md).
|
|
219
|
+
- Read the [contribution guide](CONTRIBUTING.md).
|
|
230
220
|
|
|
231
221
|
Xquik is an independent third-party service. Not affiliated with X Corp. "Twitter" and "X" are trademarks of X Corp.
|
data/SECURITY.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Security
|
|
1
|
+
# Security policy
|
|
2
2
|
|
|
3
|
-
## Supported
|
|
3
|
+
## Supported versions
|
|
4
4
|
|
|
5
5
|
Security fixes target the latest published release.
|
|
6
6
|
|
|
7
|
-
## Reporting
|
|
7
|
+
## Reporting a vulnerability
|
|
8
8
|
|
|
9
9
|
Report vulnerabilities privately through
|
|
10
10
|
[support@xquik.com](mailto:support@xquik.com).
|
|
@@ -403,8 +403,8 @@ module XTwitterScraper
|
|
|
403
403
|
# Returns the raw value associated with the given key, if found. Otherwise, nil is
|
|
404
404
|
# returned.
|
|
405
405
|
#
|
|
406
|
-
#
|
|
407
|
-
#
|
|
406
|
+
# You may look up keys absent from the API spec, such as undocumented response fields.
|
|
407
|
+
# This method does not parse response data into
|
|
408
408
|
# higher-level types. Lookup by anything other than a Symbol is an ArgumentError.
|
|
409
409
|
#
|
|
410
410
|
# @param key [Symbol]
|
|
@@ -78,8 +78,7 @@ module XTwitterScraper
|
|
|
78
78
|
|
|
79
79
|
# @api private
|
|
80
80
|
#
|
|
81
|
-
# Unlike
|
|
82
|
-
# of the enum.
|
|
81
|
+
# Unlike primitives, `Enum` validates membership.
|
|
83
82
|
#
|
|
84
83
|
# @param value [String, Symbol, Object]
|
|
85
84
|
#
|
|
@@ -37,16 +37,14 @@ module XTwitterScraper
|
|
|
37
37
|
optional :idempotency_key, String
|
|
38
38
|
|
|
39
39
|
# @!attribute extra_query
|
|
40
|
-
# Extra query params
|
|
41
|
-
# `query` given at the client level.
|
|
40
|
+
# Extra query params merge into any `query` given at the client level.
|
|
42
41
|
#
|
|
43
42
|
# @return [Hash{String=>Array<String>, String, nil}, nil]
|
|
44
43
|
optional :extra_query,
|
|
45
44
|
XTwitterScraper::Internal::Type::HashOf[XTwitterScraper::Internal::Type::ArrayOf[String]]
|
|
46
45
|
|
|
47
46
|
# @!attribute extra_headers
|
|
48
|
-
# Extra headers
|
|
49
|
-
# `extra_headers` given at the client level.
|
|
47
|
+
# Extra headers merge into any `extra_headers` given at the client level.
|
|
50
48
|
#
|
|
51
49
|
# @return [Hash{String=>String, nil}, nil]
|
|
52
50
|
optional :extra_headers, XTwitterScraper::Internal::Type::HashOf[String, nil?: true]
|
|
@@ -29,8 +29,7 @@ module XTwitterScraper
|
|
|
29
29
|
sig { returns(T.nilable(String)) }
|
|
30
30
|
attr_accessor :idempotency_key
|
|
31
31
|
|
|
32
|
-
# Extra query params
|
|
33
|
-
# `query` given at the client level.
|
|
32
|
+
# Extra query params merge into any `query` given at the client level.
|
|
34
33
|
sig do
|
|
35
34
|
returns(
|
|
36
35
|
T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
|
|
@@ -38,8 +37,7 @@ module XTwitterScraper
|
|
|
38
37
|
end
|
|
39
38
|
attr_accessor :extra_query
|
|
40
39
|
|
|
41
|
-
# Extra headers
|
|
42
|
-
# `extra_headers` given at the client level.
|
|
40
|
+
# Extra headers merge into any `extra_headers` given at the client level.
|
|
43
41
|
sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
|
|
44
42
|
attr_accessor :extra_headers
|
|
45
43
|
|