A Twitter bot that tweets blog updates from around the MTBoS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


MTBoS Blogbot

I, Robot

This is the code that powers the @MTBoS_Blogbot, for those of you who like your RSS feed Twitterfied. Follow the Blogbot or check out the MTBoS Blogroll web page for regular updates from blogs around the mathtwitterblogosphere, which is a pretty cool place. Even for a robot.

Adding Yourself to the Blogroll

Feel free to tweet @MTBoS_Blogbot and let me/it know that you'd like to be added to the blogroll. Or, I suppose, let me know that you don't want to be on it anymore (I pulled your info from @Jstevens009's list on fishing4tech).

Of course, if you're a GitHub kind of person who's going to fork the repo anyway, you can just add yourself to blogroll.yaml (alphabetically by Twitter handle) and submit a pull request. Just make sure that the feed_url points to something that returns your XML feed.

Getting the Code

As you presumably know, the code is hosted at https://github.com/ctlusto/mtbos-blogbot.

To get your own copy of the repo and see what's what:

git clone git://github.com/ctlusto/mtbos-blogbot.git
cd mtbos-blogbot

You're going to need pip to install Python packages. If you don't already have it:

sudo easy_install pip

You're also going to need virtualenv to manage dependencies:

pip install virtualenv

Setting Up for Development

Create a virtual environment and install dependencies:

make env

If you already have a virtual environment, just install dependencies:

make deps

Activate your virtual environment:

source env/bin/activate

When you're done hacking, you can simply deactivate the virtual environment:


Running Tests

LOLWUT!? There are no tests.

Firebase and Twitter

The Blogbot uses Firebase as a backend data store and the Twitter API to post updates. If you want your bot to do something useful, you'll need to set up a Firebase app and register your app with Twitter.

From there, you'll need to include some of your account credentials in order to authorize requests. The stuff you'll need to get is listed in config.example.py. Fill in the empty strings with your personal keys and tokens from their respective providers and rename the file config.py. (Make sure you don't check your actual config.py file into source control, please.)

Creating/Updating a Blogroll

The feeds you want to follow should live in blogroll.yaml. Just make sure that the feed_url points to something that returns XML (not, for example, the main blog page).

Save your changes and run:

make migrate

Any feeds that aren't already in Firebase will be added to the database and have a current snapshot recorded.

Tweeting Updates

To check for updates and tweet any new posts:

make publish

If you want to check for updates and tweet them on a regular basis, you can run blogbot.py as a Cron job. Just like a real robot.


Chris Lusto

Twitter: @Lustomatical

Site: {math pun}