Giter VIP home page Giter VIP logo

simple-twitter-bot-setup-on-heroku's Introduction

Simple Twitter Bot Setup On Heroku

Pre-requisite

  • Python Installed Obviously
  • VirtualEnv Installed (pip install virtualenv)
  • You must know how to deploy app on heroku Read here

Get Started

We're going to use heroku's worker dyno to acomplish this task. Although you can use job scheduling to run your bot at certain time than keep running it all time.

  • Clone this Repo
  • run virtualenv twibot --no-site-packages and activate it.
  • Make changes to main.py because this is your Bot main entry file.
  • see main_example.py for reference.
  • When all done means when you've your working bot locally. Run pip freeze requirements.txt in the bot directory.
  • And finally deploy and scale the worker dyno or run it.

For instance you can put your Twitter App credentials in main_example.py and run it.

Quick Walkthrough

Procfile

This is main file which tells Heroku, which dyno to use. We're using worker dyno. Learn more about dyno. So worker: python main.py tells heroku to run worker dyno and run python main.py command on that.

Requirements (requirements.txt)

This is file created by pip when we run pip freeze requirements.txt. This is important because heroku will look for this file to install module dependency of your bot.

Runtime (runtime.txt)

If you're using python 2.7 then change runtime in this file. Available runtimes are listed here

db.json

This file is part of main_example.py to keep track of retweets/day.

Further Ideas

  • You're not limited to just retweet bot. Read Tweepy Docs. For example you can use filters to filter tweets by users or any other.
  • For Data Analysis people, you may want to use PGSQL provided by Heroku to store analysis data

Me

Twitter: @shahidcodes

simple-twitter-bot-setup-on-heroku's People

Contributors

shahidcodes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.