Created
May 18, 2012 21:18
-
-
Save anonymous/2727649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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