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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07ed3b8240c037a3f99aca376db32637542303f31d4aa2e1ab3cbbd45e94e595
4
- data.tar.gz: 3a04bda0ac118544b66225dd59839060d7032a159cbc0a80ea91bacc506c51c2
3
+ metadata.gz: 2eed85b02b44c9bcefbbec637c0063d3f95038d8951f30108ad4ab3853a60335
4
+ data.tar.gz: 3b26cbff158153d925e414d3b8fea75ae087b49d96014125a96c2c7e7b9a7667
5
5
  SHA512:
6
- metadata.gz: 34ffbe878b79d348581e1b993c3e0745869e2dc3a629fd1519bdda9ab14874af696c74fac495d460813f27fe918b7aae50bd58bf8cc242989dbd05a09d1b55c1
7
- data.tar.gz: c5286cb6368825d7a98c4bd48e50ac08c4f506898a991a3f6080ae1b1cd8d6c82fa38d0243716bdbfb86546ff22e1366273176d184e16b0b75a3bd3a6279d272
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
- # X (Twitter) Scraper Ruby SDK: Tweet Search, Timelines, Followers & Posting
1
+ # Xquik Ruby SDK: Twitter Search, Followers & X Automation
2
2
 
3
3
  [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/13739/badge)](https://www.bestpractices.dev/projects/13739)
4
4
 
5
- Use Xquik's typed Ruby client for X data and confirmed actions.
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
- ## Documentation
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 using typed request objects and Sorbet.
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 Data Tasks
13
+ ## Common Twitter & X Tasks
18
14
 
19
- Use the linked Ruby reference for typed method names.
15
+ Map each task to its REST route.
20
16
 
21
- | Customer Question | REST Route | Workflow Note |
17
+ | Task | REST Route | Usage |
22
18
  | --- | --- | --- |
23
- | How do I search tweets? | `GET /x/tweets/search` | Use keyword or advanced operator queries. |
24
- | How do I read a profile timeline? | `GET /x/users/{id}/tweets` | Paginate bounded results. |
25
- | How do I scrape followers? | `GET /x/users/{id}/followers` | Use an extraction for complete datasets. |
26
- | How do I scrape following accounts? | `GET /x/users/{id}/following` | Use an extraction for complete datasets. |
27
- | How do I read my home timeline? | `GET /x/timeline` | Approve this private read. |
28
- | How do I monitor an account? | `POST /monitors` | Deliver events through HMAC webhooks. |
29
- | How do I post or reply? | `POST /x/tweets` | Confirm the account and payload. |
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.1"
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 errors
56
+ ### Handling Errors
59
57
 
60
- When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `XTwitterScraper::Errors::APIError` will be thrown:
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("The server could not be reached")
67
- puts(e.cause) # an underlying Exception, likely raised within `net/http`
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("A 429 status code was received; we should back off a bit.")
67
+ puts("Rate limited. Retry later.")
70
68
  rescue XTwitterScraper::Errors::APIStatusError => e
71
- puts("Another non-200-range status code was received")
69
+ puts("The server returned another non-2xx status.")
72
70
  puts(e.status)
73
71
  end
74
72
  ```
75
73
 
76
- Error codes are as follows:
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
- Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
95
-
96
- Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.
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
- # Configure the default for all requests:
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
- # Or, configure per-request:
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
- By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:
108
+ Requests time out after 60 seconds. Set `timeout` to change or disable this limit:
113
109
 
114
110
  ```ruby
115
- # Configure the default for all requests:
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
- # Or, configure per-request:
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
- Note that requests that time out are retried by default.
122
+ Timed-out requests follow the default retry policy.
127
123
 
128
- ## Advanced concepts
124
+ ## Advanced Concepts
129
125
 
130
126
  ### BaseModel
131
127
 
132
- All parameter and response objects inherit from `XTwitterScraper::Internal::Type::BaseModel`, which provides several conveniences, including:
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
- 2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.
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
- 3. Both instances and the classes themselves can be pretty-printed.
137
+ ### Making Custom or Undocumented Requests
139
138
 
140
- 4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.
139
+ #### Undocumented Properties
141
140
 
142
- ### Making custom or undocumented requests
141
+ Send undocumented parameters and read undocumented response properties:
143
142
 
144
- #### Undocumented properties
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 request params
158
+ #### Undocumented Request Parameters
164
159
 
165
- If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.
160
+ Pass extra values through `extra_query`, `extra_body`, or `extra_headers` under `request_options:`.
166
161
 
167
- #### Undocumented endpoints
162
+ #### Undocumented Endpoints
168
163
 
169
- To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:
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 & connection pooling
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
- Each instance of `XTwitterScraper::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
186
-
187
- When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.
188
-
189
- Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.
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
- You can provide typesafe request parameters like so:
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, but are not typesafe:
191
+ # Hashes work without type safety:
205
192
  x_twitter_scraper.x.tweets.search(q: "from:elonmusk", limit: 10)
206
193
 
207
- # You can also splat a full Params class:
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
- Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
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 have a "relaxed" type, so you can either pass in enum constants or their literal value:
212
+ Enum parameters accept constants or literal values:
225
213
 
226
214
  ```ruby
227
- # Using the enum constants preserves the tagged type information:
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 are also permissible:
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) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.
230
+ This package follows [SemVer](https://semver.org/spec/v2.0.0.html). Version `0` releases may change APIs.
243
231
 
244
- This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.
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
- We aim to acknowledge reports within 3 business days. We will coordinate a
16
- disclosure timeline after confirming the issue.
15
+ Maintainers acknowledge reports within 3 business days.
16
+ We coordinate disclosure after confirming the issue.
17
17
 
18
18
  ## Scope
19
19
 
@@ -5,5 +5,5 @@
5
5
  # frozen_string_literal: true
6
6
 
7
7
  module XTwitterScraper
8
- VERSION = "0.10.1"
8
+ VERSION = "0.10.2"
9
9
  end
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.1
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 the Xquik API
975
+ summary: Ruby SDK for Twitter search, followers, webhooks & X automation. Not affiliated
976
+ with X Corp.
976
977
  test_files: []