Skip to content

Instantly share code, notes, and snippets.

Created May 18, 2012 21:18
Show Gist options
  • Save anonymous/2727649 to your computer and use it in GitHub Desktop.
Save anonymous/2727649 to your computer and use it in GitHub Desktop.
on :message, ".rage" do |m|
tweet = Twitter.user_timeline("_ragestache").first.text
# Checks if the tweet has an url anywhere in it.
if tweet =~ /http[s]:\/\//
# If it has, it will not be outputted to the file
m.reply "ERROR: The latest tweet had an url in it. Wont be added!"
else
File.open("#hi.txt" , 'a') { |f| f.puts "#{tweet} || Fact added by: http://twitter.com/_ragestache" }
m.reply "Added http://twitter.com/_ragestache latest fact."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment