github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

balinterdi / hashtag_retweet_bot forked from jaimeiniesta/hashtag_retweet_bot

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 5
    • 1
  • Source
  • Commits
  • Network (1)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Script that was thrown together to listen for #sor09 tags and retweet them — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

making a list of the live examples 
balinterdi (author)
Mon Aug 17 06:11:52 -0700 2009
commit  a8b2af6a5b8d2c4753ac4ab1d2677fac39838a24
tree    32bf2524c98a61b67ae31de9f6d0dec7b9b8e79a
parent  bdd4f70c8f9a8abd2685f879522b8e7ce5f23820
hashtag_retweet_bot /
name age
history
message
file .gitignore Loading commit data...
file Manifest
file README.markdown
file Rakefile
directory bin/
file create_db_table.rb
file feed.rb
file hashtag_retweet_bot.gemspec
directory lib/
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 tweet 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 balinterdi-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
  • The bot for the Budapest Ruby User Group

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 balint.erdi@gmail.com

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server