GithubHelp home page GithubHelp logo

weaksauce / bambot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terrrydactyl/bambot

0.0 2.0 0.0 83 KB

Bambot is a twitter bot that keeps track of how long your pet has been accident free.

Python 100.00%

bambot's Introduction

Bambot

Bambot is a twitter bot that keeps track of how long your pet has been accident free.

Setup

####Getting the Twitter keys Before Bambot can run, you need to sign up with a Twitter dev account and register a new app: https://dev.twitter.com/apps/new.

You'll need:

  • Consumer Key
  • Consumer Secret
  • Access Token Key
  • Access Token Secret

Paste the values in the config file. I've included a sample_config.py file. Make sure you rename it to config.py.

?> mv sample_config.py config.py

####Getting the code To pull the code to your server, run:

?> git clone https://github.com/terrrydactyl/bambot.git /some/directory

####Installing the python-twitter library To install the python-twitter library, run:

?> sudo pip install python-twitter

*Note: you can run without sudo if you are running via virtualenv

####Creating the database Bambot uses sqlite3. To create your database run:

?> sqlite3 yourdatabase.db

To set up your table run:

sqlite> .read setup.sql

Your database is now ready for all your pet's accidents!

Logging Accidents

Every time your pet has an accident, you can update your twitter bot by running this prompt:

?> python bambot_script.py --accident "location" "accident_type"

Location is required, but accident_type is optional and defaults to "pee". Bambot will post to your twitter with the following message: I had an accident at [location]. :(

Setting up streak

Bambot will also update the twitter feed with how long it has been since the last accident when run without an accident flag. You can set up how often Bambot updates by setting up a cronjob.

?> crontab -e

Mine looks like this:

#MIN HOUR DOM MON DOW CMD
30   13   *   *   *   /path/to/bambot_script.py

Contact

If you have any questions, comments, or bug reports, feel free to send me an email at tchoN at gmail.com, replace N with 308+400.

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.