Deprecate Faker::Twitter in favor of Faker::X and update attributes#3138
Merged
Deprecate Faker::Twitter in favor of Faker::X and update attributes#3138
Faker::Twitter in favor of Faker::X and update attributes#3138Conversation
Besides renaming the generator to Faker::X, the generator is vastly outdated. Twitter, aka X API, has changed a lot (it's now v2), and most of the attributes being returned in the user have been deprecated: https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/data-dictionary#no-longer-supported-deprecated-attributes To maintain backwards compatibility, users still using Faker::Twitter will keep using it but be notified of the upcoming changes. Initially, the goal was to only update the `user` generator but then I realized it wouldn't make sense to leave `status` as it is.
e846c63 to
68d4aa1
Compare
After working on the user generator, it made sense to also deprecate the `status` one. The API migration docs don't mention changing status to tweet, but after inspecting what `status` returns, I realized the new API calls is `tweet`. There were lots of changes for both user and tweet objects. Most notably, the shape of the response, additional fields, and removal of deprecated attributes. Used resources as references: - https://docs.x.com/x-api/migrate/data-format-migration#user-object - https://docs.x.com/x-api/fundamentals/data-dictionary#tweet - https://docs.x.com/x-api/migrate/data-format-migration#entities-and-expanded-entities-objects
68d4aa1 to
f2aa395
Compare
Contributor
Author
|
The change introduced in #3144 is failing for ruby head. If I add the gem version explicitly back again, tests pass locally. Might be an issue that gets fixed down the road when ruby 4.0 is released? |
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
thdaraujo
reviewed
Nov 22, 2025
cf19b87 to
9b52e23
Compare
Faker::Twitter in favor of Faker::X and update attributes
Contributor
|
created an issue #3147 to fix the problem on CI -> https://github.com/faker-ruby/faker/actions/runs/19600283917/job/56130782276?pr=3138 |
stefannibrasil
added a commit
that referenced
this pull request
Jan 8, 2026
…es (#3138) * Add deprecation warning for Faker::Twitter Besides renaming the generator to Faker::X, the generator is vastly outdated. Twitter, aka X API, has changed a lot (it's now v2), and most of the attributes being returned in the user have been deprecated: https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/data-dictionary#no-longer-supported-deprecated-attributes To maintain backwards compatibility, users still using Faker::Twitter will keep using it but be notified of the upcoming changes. Initially, the goal was to only update the `user` generator but then I realized it wouldn't make sense to leave `status` as it is. * Deprecate Faker::Twitter and update status to tweet After working on the user generator, it made sense to also deprecate the `status` one. The API migration docs don't mention changing status to tweet, but after inspecting what `status` returns, I realized the new API calls is `tweet`. There were lots of changes for both user and tweet objects. Most notably, the shape of the response, additional fields, and removal of deprecated attributes. Used resources as references: - https://docs.x.com/x-api/migrate/data-format-migration#user-object - https://docs.x.com/x-api/fundamentals/data-dictionary#tweet - https://docs.x.com/x-api/migrate/data-format-migration#entities-and-expanded-entities-objects * Update docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Background
Closes #3131
Faker::Twitterhas never been updated since it was introduced. Not only has the platform's name changed, but their objects have changed a lot.After working on the user generator, it made sense to also deprecate the
statusone. The API migration docs don't mention changing status to tweet, but after inspecting whatstatusreturns, I realized the new API calls istweet.There were lots of changes for both user and tweet objects. Most notably, the shape of the response, additional fields, and removal of deprecated attributes. Used resources as references:
Additional information
I will include a noticeable note in the CHANGELOG when this gets released.
The documentation has been updated to reflect the output changes. The changes were made to match the API's new structure as much as possible, however, I took the liberty of excluding some empty fields that faker included in the past. X's API does not return null fields in their response anymore ("X is adopting the convention that JSON values with no value (for example, null) are not written to the payload. Post and user attributes are only included if they have a non-null values." from Updated JSON design).
Examples of the responses:
Faker::X.tweet