GithubHelp home page GithubHelp logo

justadudewhohacks / twitter-greet-followers-bot Goto Github PK

View Code? Open in Web Editor NEW
27.0 3.0 12.0 9 KB

A simple twitter bot to send your new followers a nice greeting message.

JavaScript 100.00%
twitter twitter-api twitter-streaming-api twitter-bot javascript followers

twitter-greet-followers-bot's Introduction

A simple twitter bot to send your new followers a nice greeting message.

demo

Requirements

Credentials for the twitter api

Create a twitter app for your twitter account and switch to the tab Keys and Access Tokens. If you do not have an access token yet click Create my access token. Now you should have all your credentials:

twitter-credentials

Heroku account

If you do not have a heroku account, set one up and install the heroku cli .

Set up your bot

  1. Clone the repository:
git clone https://github.com/justadudewhohacks/twitter-greet-followers-bot
cd twitter-greet-followers-bot
  1. Create a heroku app:
heroku app:create mytwitterbot1234
  1. Set your twitter-api credentials as environment variables:
heroku config:set consumer_key=xxx
heroku config:set consumer_secret=xxx
heroku config:set access_token=xxx
heroku config:set access_token_secret=xxx
  1. Edit greeting.js and insert your greeting message

greeting

  1. Commit the changes and push to heroku
git add .
git commit -m "changed the greeting message"
git push heroku master
  1. Stop the web dyno (default) and start your app in a worker dyno:
heroku ps:scale web=0 worker=1
  1. Testing your bot:

If everything worked your bot should be running. You can test your bot by following: justapoliteguy, who will follow you back. Check if your greeting message was sent. You can retry as many times as you wish by unfollowing and following again.

Trouble Shooting

In case your bot does not seem to work, you can open the heroku dashboard of your app and navigate to View logs by clicking the More button in the upper right corner:

heroku-log

If you see the output credentials ok — running bot, the bot should be up watching for new followers. As the log only displays a few lines, you can also dump the log to a text file:

heroku logs -a mytwitterbot1234 >> logs.txt

Another thing you might want to check is, whether your credentials are set up correctly. Navigate to the Settings tab and click Reveal Config Vars. Check and edit your credentials here.

twitter-greet-followers-bot's People

Contributors

justadudewhohacks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.