Skip to main content

BUILDING A TINDER BOT WITH PYTHON



I have included a function for automating the method of getting an auth token for the Tinder bot to figure (Tinder Token Retriever). Shout bent the developer! to ascertain a post of the code, view this post: Automatic Tinder Authentication Token Retriever in Python. The update has been included within the code file that's linked below. thanks to this update, the manual process that's described below for obtaining an auth token is no longer needed. I keep it included within the blog post, however, for reference just in case the automated code ever stops working.

Video tutorial

BEGINNING OF ORIGINAL POST:

It’s 2016 and online dating appears to be here to remain . one of the more popular online dating apps is Tinder, the bane of my existence. You line update after date, browsing an equivalent ole song and dance whenever, asking and answering equivalent questions, having an equivalent conversation, to the purpose that it feels robotic. It’s a game of numbers, bulk dating, spray and pray, and it all just seems so shallow. So what does a nerd trying to simultaneously learn Python and dating do? He makes it even more shallow by building an actual bot!

A tinder bot can automatically swipe right for you and even send automated messages if you actually want to urge fancy. However, I should warn you with the standard disclaimer. Any attempts to spam or harass anyone through the utilization of a bot aren't condoned alone or Tinder. It could lead to Tinder shutting down your account or worse. What you'll do is minimize the quantity of labor needed to play the dating field, increase your chances of getting matches by auto-swiping, and use data to optimize your swipes, messages, and dates. This post is merely for educational purposes. Now let’s start.

You’ll only need two (plus a 3rd optional) things to create a Tinder bot:

Facebook+Tinder authentication
Burp (https://portswigger.net/burp/download.html) (optional)
Python with Pynder installed
(NOTE: THIS NEXT SECTION isn't REQUIRED, as long as I even have INCLUDED A FUNCTION FOR AUTOMATING GETTING AN AUTHENTICATION TOKEN (Tinder Token Retriever) within the LATEST VERSION OF THE BOT POSTED BELOW.)

First, to line up authentication, use your desktop browser (I would recommend Chrome) to travel to the Facebook profile which will be used with Tinder. Right-click the Facebook profile, website and choose “View Page Source”. Then, command+f (or ctrl+f for Windows users) to seek out “profile_id” within the ASCII text file. Save the worth listed for the profile_id. This may be used because of the FACEBOOK_ID for authentication.

Now, if you've got already signed into Tinder through this Facebook profile, then you’ll get to attend the Facebook Settings and choose the Apps settings tab. Then, remove Tinder from the Apps logged in with Facebook. Once you’ve removed Tinder, there on the same browser tab, right-click and choose “Inspect”. Then, within the browser URL bar, paste this URL: https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=fbconnect://success&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token&__mref=message. Click “Continue” when prompted. Now, return to the “Inspect” window and we’re getting to search for the authentication token. Attend the “Network” tab. Select “XHR” for the filter. Then search for one named something like “read?dpr=2”. If you click thereonyou ought to see some stuff within the “Preview” window. Click the arrow next to “mods” within the “Preview” window. Keep clicking through the nested arrows (“require”, “0”) until you see a final arrow (possibly next to a variety like “3”). Click this final nested arrow and there should be a URL like “fbconnect://success#access_token=” with a token behind it. Save that token. It'll be used because of the FACEBOOK_AUTH_TOKEN for your bot.

(OPTIONAL) Second, you’ll install Burp on your desktop/laptop. Burp may be a tool want to intercept requests and responses through a proxy, acting sort of a middle man, allowing you to ascertain how an internet site or app is working under the hood. Once you've got Burp installed on your desktop/laptop, you’ll get to configure it so that traffic from your phone is piped through a proxy found out in Burp. Burp has much good documentation on the way to set this up:

Configuring an iOS Device to figure with Burp (https://support.portswigger.net/customer/portal/articles/1841108-configuring-an-ios-device-to-work-with-burp)
Configuring an Android Device to figure with Burp (https://support.portswigger.net/customer/portal/articles/1841101-configuring-an-android-device-to-work-with-burp)

Once you’ve configured your mobile device to run through Burp’s proxy, there are just a couple of other options you’ll want to line up. Within the Proxy tab under Options, confirm all the boxes are checked for Intercept Client Requests and Intercept Server Responses. This may ensure everything needed to create the Tinder bot is intercepted.

Now you’re able to start seeing how Tinder requests and responses are formatted. With “Intercept” turned on in Burp on your desktop, open Tinder on your mobile device. you ought to see information populate in Burp. If you would like to explore the various requests and responses, you'll hit the “Forward” button to permit the actions to travel through as you employ Tinder. you'll use Burp to reverse engineer virtually any API, including Tinders. So, should Tinder ever make any changes to their API, or should the way they authenticate to Facebook change, you'll always come to Burp as a tool for helping determine what changed and the way to regulate.

Using Burp isn't required for this Tinder bot to figure, but it's a tool that will prove forever useful if you would like to explore adjusting your bot or building other bots. For the needs of subsequent steps, you'll keep Burp turned off and your browser or mobile device running with no proxy. this may allow Tinder’s API requests/responses and your browser to figure as normal.

Essentially, our Tinder bot will operate by authorizing itself, then mimicking the Tinder API requests/responses through Python code. Luckily, there's a Python library called Pynder that creates setting this up easy, which brings us to our third step:

Pinder (https://pypi.python.org/pypi/pynder/0.0.11)
Assuming you have already got Python and pip installed, you'll install Pynder by simply opening your terminal and typing sudo pip install ponder. Now let’s get into the particular Python code.

The flow structure of our Tinder bot will go like this:

Start a Tinder session by authorizing
Check if we've reached our swipe limit
If we are out of swipes, move along to send messages to the matches (steps 7+)
Else, auto-swipe right (except randomly swipe left 1 outing of each 100 swipes to look more human).
Sleep between 1 and 5 seconds randomly amounts in between each swipe (to seem more human).
Continue swiping until out of swipes, then move along to send messages to the matches.
Grab the list of matches.
For each match, grab the list of messages already in our inbox.
If a match isn’t already in our messages, send them the primary message to start out a conversation.
If the amount of messages already sent to the match is bigger than or adequate to the length of our list of messages to send, log the conversation is finished thereupon match.
Else, if the newest message is from me, log that there are not any new messages from that match and move along to the subsequent match.
Else, if there's a new message from someone and it contains the words “bot”, “fake”, or “real person”, then send the acceptable responding message (we have different message lists for every word to form the conversation somewhat dynamic).
Else send a subsequent generic message. Then move along to the subsequent match.
Do this for every match within the list of matches.
Log resting for a couple of minutes and sleep a random amount between 300 and 600 seconds (to seem more human).
Repeat.
**UPDATE 11-19-17** I even have UPLOADED a replacement VERSION OF THE TINDER BOT (BELOW) that has A FUNCTION FOR AUTOMATING the method OF GETTING AN AUTH TOKEN (Tinder Token Retriever).

Here is a .zip file of the code (I named my bot Tinderly):

Tenderly

You’ll notice the folder contains a config.ini file for the Facebook profile ID, email, password, and Facebook auth token (which I detailed the way to find manually earlier during this post). Insert your Facebook email, password, and ID into this file. There also are separate Python files for the varied dynamic conversations with lists of messages. you'll change the conversations to your liking by editing what keywords you would like to seem for and changing the message lists for every keyword. And most significantlythere's a tinderly.py file that's the most bot script.

I’ll allow you to fiddle with the code yourself and won’t spend the time posting it all here, but there's one change I had to form to the Pynder library code to permit checking if you’ve run out of swipes. My Pinder downloaded to Macintosh HD > Library > Python > 2.6 > site-packages > ponder. Once you'll locate your local Pynder folder, open the api.py and enter a text editor. there's a function called “like”, I changed the function to be defined like this:

Once you’ve made this alteration, save the api.py file and your Tinder bot is going to be able to run.

The last step for setting the bot up is to update the configuration file (config.ini) to use your Facebook email, password, and ID.

To run the bot (on Mac), open a Terminal window and “cd” navigate to the directory/folder where you've got the Python scripts saved. Then simply run the command “python tinderly.py” (or whatever you named your Python script).

Thanks for finding out my ramblings and stay tuned for several more to come! be happy to go away with any comments or questions you'll have about this project. In the meantime, good luck swiping and keeping a Tinder heart.

Comments

Popular posts from this blog

Things to know before you start programming

While you're studying programming, I’m studying the way to play guitar. I practice it each day for a minimum of two hours a day. I play scales, chords, and arpeggios for an hour a minimum of then learn music theory, ear training, songs, and anything I can. Some days I study guitar and music for eight hours because I desire it and it’s fun. To me, repetitive practice is natural and is simply the way to learn something. I know that to urge good at anything you've got to practice a day , albeit I suck that day (which is often) or it’s difficult. Keep trying and eventually it’ll be easier and fun. Remember that anything worth doing is difficult at first. Maybe you're the type of one that is scared of failure, so you hand over at the first sign of difficulty. Maybe you never learned self-discipline, so you can’t do anything that’s “boring.” Maybe you were told that you simply are “gifted,” so you never attempt anything which may cause you to seem stupid or not a prodigy. Maybe y...

Wifi Password Viewer.

Wi-Fi is the wireless technology that connects computers, tablets, smartphones, and other prejudices to the Internet. Wi-Fi is the radio signal transmitted from a wireless router to a nearby unit, which translates the signal into data that you can see and use . Windows Computer Save their Password in system Files. This PowerShell script collects a password and shows it on the table. Learn more Download Requirements:  *PowerShell Download File and right click on it. Select "run with PowerShell" then see the Magic!! Tada

Computer Vision: Algorithms and Applications

As humans,we perceive the three-dimensional structure of the planet around us with apparent ease. Think of how vivid the three-dimensional percept is once you check out a vase of flowers sitting on the table next to you. You can tell the form and translucency of every petal through the subtle patterns of sunshine and shading that play across its surface and effortlessly segment each flower from the background of the scene The forward models that we use in computer vision are usually developed in physics (radiometry, optics, and sensor design) and in computer graphics . Both of these fields model how objects move and animate, how light reflects off their surfaces, is scattered by the atmosphere, refracted through camera lenses (or human eyes), and finally projected onto a flat (or curved) image plane. While computer graphics aren't yet perfect (no fully computer animated movie with human characters has yet succeeded at crossing the uncanny valley2 that separates real humans from...