Git Product home page Git Product logo

hello-twitter's Introduction

hello-twitter

A simple Twitter bot made with Python

What it does

  1. Looks for tweets that mention a user.
  2. Scans through the last 20 mentions for #HelloWorld
  3. If the mention contains #TeamSeas, it replies to the mention with the pounds of trash removed by #TeamSeas
  4. If the mention contains #HelloWorld, it replies to that tweet with hi

Setup

Twitter developer account setup

For this to work, you need to have a Twitter developer account.

  1. To get a developer account, follow this tutorial.
  2. After getting a developer account, you need to create a project and an app
  3. To generate the keys, go to the app you created and go to Keys and tokens

Program Setup

Install dependencies
May need to use pip3

pip install -r requirements.txt
Create a file in the same folder as hello-twitter.py named .env and configure it as follows, then run the program (or you can use enviroment variables)

CONSUMER_KEY = "Your consumer key"
CONSUMER_SECRET = "Your consumer secret"
ACCESS_KEY = "Your access key"
ACCESS_SECRET = "Your access secret"

If you want to run this as a service edit the configuration of hello-twitter.service to your needs
Then copy to /etc/systemd/system/

Roadmap

  • Instead of storing keys in config.py store in JSON enviroment variables and .env
  • Allow bot to scrape webpages and answer questions
    For example, getting the amount of pounds of trash removed by #TeamSeas. DONE! (not with webscraping, downloading json instead)
  • Have a help command

One more thing

If you find any bugs, please create a Github issue to report the bug so it can be fixed.

hello-twitter's People

Contributors

slashtechno avatar

Watchers

 avatar

Forkers

retuka1

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.