Git Product home page Git Product logo

inpycon-twitterbot's Introduction

inpycon-twitterbot

Open Source Love PyPI - Python Version License: MIT

A twitter bot made using Python and Twitter API to retweet posts using specific terms related to the conference and be beneficial to thea social media campaign by keeping all tweets about PyCon India in one place and get the event trending. It could be hastags, twitter handles, slang words. Anything.

Setup and Running the bot

Install the Requirements

  • Fork and clone this repository,
git clone <Forked repository URL>
  • Run the following command in your terminal, be sure to have Python3 already setup in your system.
pip3 install -r requirements.txt --user 

Creating Twitter API Credentials

  1. Go to the https://apps.twitter.com/
  2. Click the Create App button
  3. Fill the necessary details for your application that you are creating
    • Name of the bot
    • Website name
    • Description
  4. Once created, goto Keys and Tokens section and generate your access tokens.
  5. Once located, move on to the next step for configuring scripts/config.py

Configuring Tweepy API

  • For the bot to run, the Tweepy API needs to be authorised with consumer_key, consumer_secret, access_token and access_token_secret. These values are listed in scripts/config.py and needs to be filled before the execution of main.py script for connecting to the Twitter API

  • searchterms in config.py are the target terms, the bot checks for these terms constantly, so for example, if the user is searching for PyConIndia2018so the terms in the list are as follows ["#PyConIndia2018","PyConIndia","@pyconindia","#pyconindia"]

  • Add hashtags, specific words, user handles in the searchterms. Anything you want retweeted.

Running the Bot

  • Navigate to the scripts directory and run the bot using the following command
  python3 main.py

Hosting on Heroku

Use the following commands to host this app in heroku

heroku create
git add .
git commit -m "initial commit"
git push heroku master
heroku ps:scale worker=1
heroku logs --tail

Contribution and Licence

Refer to the Contributing.md for the same. The source code is under MIT License.

inpycon-twitterbot's People

Contributors

a2un avatar inovizz avatar rohithgilla12 avatar vipulgupta2048 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.