Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am mbd-s on github.
  • I am mbds ( on keybase.
  • I have a public key ASDGO235c5FZ_NRxopFtwoTPuGc79szNBaIkLpKX4q6QZgo

To claim this, I am signing this object:

mbd-s /
Last active May 1, 2022 08:21
Building a simple Twitter bot with the Twitter Ruby gem

##Twitter gem overview

The Twitter Ruby gem is a Ruby interface to the Twitter API. It allows you to make all available Twitter API requests (e.g., tweet, follow a user, search, etc.) within a Rails app.

This guide was adapted from multiple sources, including the Twitter Ruby gem configuration page and How to Make a Twitter Bot in Ruby on Rails. Twitter's own API docs are a good resource too, of course.

####Get set up with Twitter To begin, you'll need to register your application with Twitter and get the proper keys. Log into or sign up for a Twitter account, and scroll down to "Manage Your Apps." Click "Create a New App" and fill out the form with the app's details. Once you're on the app's management page, select the "Permissions" tab. Make sure access is set to "Read a