public
Fork of rubaidh/hashtag_retweet_bot
Description: Twitterbot to retweet everything tagged with a given hashtag
Homepage:
Clone URL: git://github.com/jaimeiniesta/hashtag_retweet_bot.git
Click here to lend your support to: hashtag_retweet_bot and make a donation at www.pledgie.com !
jaimeiniesta (author)
Sun Aug 16 09:37:45 -0700 2009
commit  a29d5f5c577b2fc7a307c059ddb362e6d7749dd2
tree    124fdc13da8972ec8711b40aee209b383e220dd0
parent  390614f3f1195fc25476c16cb3a7d8bc84c19b2d
name age message
file .gitignore Sat Jun 27 23:26:40 -0700 2009 turn script into a gem For easier installation... [Balint Erdi]
file Manifest Wed Jul 08 08:22:55 -0700 2009 gem v0.1.1 activerecord name corrected and REA... [Balint Erdi]
file README.markdown Loading commit data...
file Rakefile
directory bin/
file create_db_table.rb Sat Jun 27 23:26:40 -0700 2009 turn script into a gem For easier installation... [Balint Erdi]
file feed.rb Fri May 08 04:22:42 -0700 2009 Changed #sor09 to #euruko [jaimeiniesta]
file hashtag_retweet_bot.gemspec
directory lib/ Mon Aug 17 05:57:44 -0700 2009 Seconds of pause between updates are now config... [jaimeiniesta]
README.markdown

Hashtag retweet bot

A bot that retweets all tweets tagged by a certain hashtag. Ideal for conferences, meetup groups, communities, etc.

As an example, let's say you want to retweet every twitt found with the hashtag #icecream every 5 minutes (300 seconds). This ruby gem will let you do it as easily as running:

hashtag_retweet_bot icecream 300

Installation

gem install jaimeiniesta-hashtag_retweet_bot --source http://gems.github.com

Create the database:

mysqladmin create my_conference_db

Create a directory where you will run the bot from, and a config directory with 2 files in it: database.yml for your database settings and bot.yml for the login/password of the twitter account.

mkdir -p bot_for_my_conference/config
cd config/bot_for_my_conference
touch database.yml bot.yml

Put the credentials for the twitter account in bot.yml:

login: my_conference_bot
password: secret

Put the database connection attributes in database.yml:

adapter: mysql
username: root
host: localhost
password:
database: my_conference_db

And create the table on the database that will hold the tweets:

hashtag_retweet_bot create_db_table

Run it

Now the only thing left to do is running the bot, telling it what tag to follow, like that:

hashtag_retweet_bot tag_to_follow

This will launch the bot with a default pause of 180 seconds. If you want a different time schedule you can specify other value for the seconds parameter, but I've experienced Twitter connection problems when trying to update every 60 seconds or less:

hashtag_retweet_bot tag_to_follow seconds_between_updates

Example:

hashtag_retweet_bot icecream
hashtag_retweet_bot icecream 240

Live examples

Some twitterbots using hashtag_retweet_bot:

@euruko_bot @confrorbot

Credits

Original idea and script by Mark Connell for Scotland on Rails 2009. Customization for Euruko '09, and some improvements by Jaime Iniesta. Some improvements and gemification by Balint Erdi.

Please send feedback and bug reports to jaimeiniesta@gmail.com