npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tinderbot

v0.8.6

Published

A platform for developing bots that interact with the Tinder dating app

Downloads

16

Readme

tinderbot

A platform for developing bots which interact with the Tinder dating app

Introduction

tinderbot is a node module which allows you to develop 'bots' which interact on the Tinder dating app. It provides an easy to use mechanism for retrieving your Facebook access tokens which are used to authorize your bot for interacting with the Tinder apis, and exposes a hook for checking for Tinder updates, chatting with matches, etc.

Below is a simple bot which periodically 'likes' all matches nearby and tells them to play Castle Clash.

var tinderbot = require('tinderbot');
var bot = new tinderbot();
var _ = require('underscore')

bot.mainLoop = function() {
  bot.client.getRecommendations(10, function(error, data){
    _.chain(data.results)
      .pluck('_id')
      .each(function(id) {
        bot.client.like(id, function(error, data) {
          if (data.matched) {
            bot.client.sendMessage(
              id,
              "Hey, I'm playing this cool new game Castle Clash. Have you heard of it?"
            );
          }
        });
      });
  });
};

bot.live();

Installation

$ npm install tinderbot

Setup

Create a Facebook application

This won't need to be approved, nor publicly available. Visit the Facebook developer center and select "Apps > Create a New App". Give it a name (I named mine "TinderBot") and a category (e.g "Communication").

Authorize localhost as a Valid OAuth redirect URI

Once your app has been created, follow the Settings link in the app's dashboard, and go over to the Advanced tab. Look for "Valid OAuth redirect URI's" and add http://localhost:8080/fbtoken (or whatever you decide to use for your listen port). Also ensure the "Client OAuth Login" setting is enabled.

Setting up your tinder bot

Copy your app's App Id from the main dashboard for your app. Then, create a new .js (e.g bot.js) file with the following contents:

var tinderbot = require('tinderbot');
var bot = new tinderbot();

bot.FBClientId = <app id>
bot.FBClientSecret = <app secret>

bot.mainLoop = function() {
  console.log("Hello world!");
};

bot.live();

Running the bot

In a console, execute

$ node bot.js

To authorize your bot to act on behalf of your Facebook profile, open up a browser and visit http://localhost:8080/login. You should be prompted for your Facebook credentials. Once logged in, look back at the console and notice the periodic "Hello world" logs. Congratulations, you've just created your first Tinder bot! Make sure you keep this window open if you're planning on running your bot for a long time (ie more than an hour or so), as it will automatically refresh when your Facebook tokens have expired.

Configuration

.mainLoop

This should be set to a function that will be executed periodically. Whenever this is executed, you can assume that your bot is authorized to interact with the Tinder API on behalf of your Facebook profile. Typically you would call methods from the tinderjs module to interact with the API.

.mainLoopInterval

The interval in milliseconds at which the mainLoop is executed.

.port

Your bot wraps a simple express server. This will be the port the server listens on.

.client

This is the authorized tinder client you can use to interact with the tinder API

.live()

This starts the express server.

.die()

This kills the express server.

License

MIT