Automate posting tweets or following users from a Ruby script.
Build a bot that monitors Twitter for keywords and responds automatically.
Stream live tweets matching a topic in real time into your application.
Requires registering an app on the X developer portal to get OAuth credentials before making any API calls.
The Twitter Ruby Gem is a library that lets Ruby programs talk to the Twitter (now X) API. Instead of writing raw HTTP requests, developers call simple methods like client.update, client.follow, or client.search, and the gem handles the communication with Twitter's servers in the background. The result is that actions you would normally do in a browser, like posting a tweet, following a user, or reading a timeline, can be automated from a Ruby program. Using the library requires OAuth credentials, which you get by registering an application in the X developer portal. Once you have a consumer key, consumer secret, access token, and access token secret, you pass them to the client when setting it up. Every request you make after that is authenticated automatically. The gem covers the standard REST actions: posting tweets, fetching a user's profile or follower list, reading home and mentions timelines, looking up individual tweets by ID, and searching recent posts with filters like language or keyword exclusions. It also includes streaming clients that can receive a live feed of tweets matching certain topics, or all activity from the authenticated user's account, as it happens. The README notes that this gem targets the older API v1.1. For new projects that need the newer API v2 features, the author suggests using a separate gem called X instead. The Twitter Ruby Gem is still maintained for projects already using the v1.1 interface.
← sferik on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.