Ruby Tinder Bot: Part 1

How to set up your very own Tinder bot

June 2, 2015

One of my favorite small programming projects to do is make bots. Previously I've made Twitter and Reddit bots. This time, I decided to go for something slightly more difficult and make a Tinder bot, so here I'll outline the basic steps on how you can make one too. This tutorial assumes you have some basic knowledge in Ruby and the command line. I'll be skipping over some of the basic steps outlined in my previous bot tutorial. Unlike my previous Twitter bot, we will be unable to have this bot automatically run on its own schedule through Heroku. Also, when running your bot, please be ethical because you'll be interacting with real people on this app. Don't mess with people too much or agree to meet up with them if you have no intentions to.

Before we begin...

First, you need to set up the tinder account you'd like to use for this bot. If you wish to use an account that doesn't represent you, you'll need to create a separate Facebook account to log in with. This can get a bit tricky, because sometimes Tinder wants you to have a certain number of friends (so add random people until you get 50ish), and you'll probably need a phone number to log in with. Google Voice would do the trick. I've had a separate Facebook account for a while for projects like this so I'm not exactly sure how to get a profile set up with a new Facebook account, but if you run into problems then you should be able to find a solution online.

Time to code

We'll be using the tinder_pyro gem in our bot. Tinder doesn't actually have a public API so we'll make our requests through this gem. To authenticate, we'll need the Facebook ID and Facbeook token. The Facebook Token is annoying to work with, because it expires after a set time (which is why we can't use the Heroku scheduler this time) so we need to grab it each time we run the bot.

To get your Facbeook ID, log into the Facebook account you'll be using, replace your_facebook_username in this link with your Facebook username:

and grab your ID from that page. Getting the Facbeook token can be a bit tricky. Click on this link, and it will redirect you to a new URL. Quickly copy and paste that URL before it redirects you again. The URL will include your access token and look something like this: very long string right here is your access token!&expires_in=5614

The Facbeook ID and Facebook token are the only two things we need to log into our Tinder bot, so now we authenticate:

The annoying thing is, after the Facebook token expires, you'll have to grab it again when you want to run your code. (There is probably a better way to do this but I haven't looked into it much.)

Now we're all set for the fun stuff! Be sure to check out Part 2 for some code examples.

Questions? Comments? Don't hesitate to contact me!