|
1 | | -`Faker::Twitter` has been deprecated in favor of `Faker::X`. While it's still maintained, its docs can be found at [Faker::Twitter](#fakertwitter). |
2 | | - |
3 | 1 | # Faker::X |
4 | 2 |
|
5 | 3 | Generates approximate X (previously Twitter) user and tweet objects, based on X's API v2 responses. |
@@ -58,9 +56,9 @@ Produces a random X tweet with default attributes. Available extensions can be r |
58 | 56 |
|
59 | 57 | ```ruby |
60 | 58 | # Keyword arguments: include_user, include_media |
61 | | -Faker::Twitter.tweet #=> { data: [{:id=>"8821452687517076614", :text=>"Ea et laboriosam vel non.",... |
62 | | -Faker::Twitter.tweet(include_user: true) # Includes user attributes |
63 | | -Faker::Twitter.tweet(include_media: true) # Includes media (photo) attributes |
| 59 | +Faker::X.tweet #=> { data: [{:id=>"8821452687517076614", :text=>"Ea et laboriosam vel non.",... |
| 60 | +Faker::X.tweet(include_user: true) # Includes user attributes |
| 61 | +Faker::X.tweet(include_media: true) # Includes media (photo) attributes |
64 | 62 | ``` |
65 | 63 |
|
66 | 64 | Example outputs: |
@@ -194,35 +192,3 @@ Produces a random screen_name: |
194 | 192 | ```ruby |
195 | 193 | Faker::X.screen_name #=> "audreanne_hackett" |
196 | 194 | ``` |
197 | | - |
198 | | -# Faker::Twitter |
199 | | - |
200 | | -This generator has been deprecated. Please use `Faker::X` instead. Note that some attributes have been deprecated by [X's API](https://docs.x.com/x-api/migrate/data-format-migration). |
201 | | - |
202 | | -Available since version 1.7.3. |
203 | | - |
204 | | -Generate realistic Twitter user and status objects similar to what you would get back from the API. |
205 | | - |
206 | | -```json |
207 | | -{ |
208 | | - "created_at": "Mon Dec 10 00:00:00 +0000 2012", |
209 | | - "id": 8821452687517076614, |
210 | | - "id_str": "8821452687517076614", |
211 | | - "text": "Ea et laboriosam vel non.", |
212 | | - // ... |
213 | | -} |
214 | | -``` |
215 | | - |
216 | | -```ruby |
217 | | -# Keyword arguments: include_status, include_email |
218 | | -Faker::Twitter.user #=> {:id=>8821452687517076614, :name=>"Lincoln Paucek", :screen_name=>"cody"... |
219 | | -Faker::Twitter.user(include_status: false) # Just get a user object with no embed status |
220 | | -Faker::Twitter.user(include_email: true) # Simulate an authenticated user with the email permission |
221 | | - |
222 | | -# Keyword arguments: include_user, include_photo |
223 | | -Faker::Twitter.status #=> {:id=>8821452687517076614, :text=>"Ea et laboriosam vel non."... |
224 | | -Faker::Twitter.status(include_user: false) # Just get a status object with no embed user |
225 | | -Faker::Twitter.status(include_photo: true) # Includes entities for an attached image |
226 | | - |
227 | | -Faker::Twitter.screen_name #=> "audreanne_hackett" |
228 | | -``` |
0 commit comments