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.
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.
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-blogbotYou're going to need pip to install Python packages. If you don't already have it:
sudo easy_install pipYou're also going to need virtualenv to manage dependencies:
pip install virtualenvCreate a virtual environment and install dependencies:
make envIf you already have a virtual environment, just install dependencies:
make depsActivate your virtual environment:
source env/bin/activateWhen you're done hacking, you can simply deactivate the virtual environment:
deactivateLOLWUT!? There are no tests.
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.)
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 migrateAny feeds that aren't already in Firebase will be added to the database and have a current snapshot recorded.
To check for updates and tweet any new posts:
make publishIf 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}
MIT