-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinder-bot-tutorial.html
147 lines (118 loc) · 8.81 KB
/
tinder-bot-tutorial.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Jennifer Kruse - Ruby Tinder Bot: Part 1</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/clean-blog.css" rel="stylesheet">
<link href="css/application.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li>
<a href="http://jenniferkruse.me">Home</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<!-- Page Header -->
<!-- Set your background image for this header on the line below. -->
<header class="intro-header" style="background-image: url('img/tinderbottutorial/header.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading" style="margin-bottom: -130px">
<h1 style="color: white">Ruby Tinder Bot: Part 1</h1>
<h2 class="subheading" style="color: white">How to set up your very own Tinder bot</h2>
<span class="meta" style="color:white"> June 2, 2015</span>
</div>
</div>
</div>
</div>
</header>
<!-- Post Content -->
<article>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<p>One of my favorite small programming projects to do is make bots. Previously I've made <a href="http://jenniferkruse.me/post20150123.html">Twitter</a> and <a href="http://jenniferkruse.me/post20150302.html">Reddit</a> 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 <a href="http://jenniferkruse.me/post20150123.html">my previous bot tutorial</a>. 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. </p>
<h3>Before we begin...</h3>
<p>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. <a href="https://www.google.com/voice/">Google Voice</a> 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. </p>
<h3>Time to code</h3>
<p>We'll be using the <a href="https://github.com/nneal/tinder_pyro">tinder_pyro</a> 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.</p>
<p>To get your Facbeook ID, log into the Facebook account you'll be using, replace <b>your_facebook_username</b> in this link with your Facebook username: <br><br><b>http://graph.facebook.com/your_fb_username</b><br><br> and grab your ID from that page. Getting the Facbeook token can be a bit tricky. <a href="https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&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">Click on this link</a>, 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: <br><br>https://www.facebook.com/connect/login_success.html#access_token=<b>This very long string right here is your access token!</b>&expires_in=5614<br><br>
The Facbeook ID and Facebook token are the only two things we need to log into our Tinder bot, so now we authenticate: </p>
<img src="img/tinderbottutorial/screenshot1.png">
<p>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.)</p>
<p>Now we're all set for the fun stuff! Be sure to check out <a href="http://jenniferkruse.me/tinder-bot-tutorial-part2.html">Part 2</a> for some code examples.</p>
<p class="contactText"> Questions? Comments? Don't hesitate to <a href="http://jenniferkruse.me/about">contact me</a>!</p>
<!--
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'jenniferkruse'; // required: replace example with your forum shortname
var disqus_identifier = 'tinderbottutorial';
var disqus_url = 'http://jenniferkruse.me/blog/tinder-bot-tutorial';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
-->
</div>
</div>
</div>
</article>
<hr>
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/clean-blog.min.js"></script>
</body>
</html>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59909033-1', 'auto');
ga('send', 'pageview');
</script>