Giter Site home page Giter Site logo

coopboost's Introduction

Coopboost

Grow your twitter audience.

Deploy

First, create a Twitter application and grab the:

  • consumer key
  • consumer secret
  • access token (you'll need to click "Create my access token")
  • access token secret

Then, deploy by clicking the below button.

Deploy

Add the above Twitter credentials to your Heroku app's environmental variables. You can do so by clicking on "manage app", then "settings", then "config variables".

If you'd like to manage the environmental variables using Heroku's CLI, then be sure to clone the repo locally with the Git URL. Then you can run the following commands:

$ heroku config:set TWITTER_CONSUMER_KEY=B9pthxxxx
$ heroku config:set TWITTER_CONSUMER_SECRET=HhMXxxxx
$ heroku config:set TWITTER_ACCESS_TOKEN_KEY=3629xxx
$ heroku config:set TWITTER_ACCESS_TOKEN_SECRET=U3HQovsxxxx

Finally, seed your database with some Twitter accounts whose followers you want, i.e. Twitter accounts who are like you. (This bot will follow those accounts' followers with the intention that they'll look at your profile and follow you back.)

$ heroku run node ./tasks/add-seeds.js segment,keen_io,startupljackson

And you're done!

BONUS: MUTING AND ADDING USERS TO A TWITTER LIST

If you want to add all the people you follow into a private list, go ahead and create one. After you do so, make sure to add the following variables into your Heroku environment variables:

TWITTER_SCREEN_NAME=andyjiang
TWITTER_LIST_NAME=coopboost

The bot will then add all of the users it follows into the coopboost list. Twitter's API requires your handle, as well, which is why we also have to provide it here.

How does it work?

The cron job is in ./clock.js and it determines when to initiate the bot(). Then, three things happen:

  • given a list of twitter users, add their followers to a data store
  • get the followers from the data store and follow them (and mute them)
  • check the database for followers who haven't followed back within 30 days and unfollow them

The cronjob in ./clock.js is set to kick off this process each hour on the hour starting from 10am to 4pm pacific time. Feel free to update this to your liking. If you want to find out when your twitter followers are most active, check out this free tool, Tweriod. If you need help constructing cronJobs, check out this nifty tool.

Manually triggering tasks

You can manually kick off tasks from the terminal.

Seeding database with accounts whose followers you want

$ heroku run node ./tasks/add-seeds.js segment,keen_io,startupljackson

The last parameter here are Twitter usernames delimited by commas. You can put as many as you want here. There are no notifications if all of these followers are added to the queue, so check back every once in a while to make sure the bot has followers to follow.

Adding followers

$ heroku run node ./tasks/add-followers.js

This will go through the database of seed accounts and add their followers to another database of accounts to follow.

Following

$ heroku run node ./tasks/follow.js

This will go through the database of accounts to follow and follow them.

Unfollowing

$ heroku run node ./tasks/unfollow.js

This will go through the database of accounts, find the accounts that were followed, check if they've followed back, and if not, unfollow them.

What next?

  • Adding keywords to find tweets to favorite
  • Searching through the profile of users who follow me, then sending a targeted DM (or is that era over and now perceived as super spammy?)

Questions or complaints?

Tweet at me @andyjiang.

coopboost's People

Contributors

lambtron avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.