Skip to content

Instantly share code, notes, and snippets.

@muffinista
Created May 26, 2011 01:56
Show Gist options
  • Save muffinista/992405 to your computer and use it in GitHub Desktop.
Save muffinista/992405 to your computer and use it in GitHub Desktop.
A Simple Twitter Bot
## If I wanted to exclude some terms from triggering this bot, I would list them here.
## For now, we'll block URLs to keep this from being a source of spam
exclude "http://"
blacklist "mean_user, private_user"
puts "checking for replies to me"
replies do |tweet|
# replace the incoming username with the handle of the user who tweeted us
src = tweet[:text].gsub(/@echoes_bot/, tweet_user(tweet))
# send it back!
reply src, tweet
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment