Browse files

Added a way to display tweets since the title tag is broken

  • Loading branch information...
1 parent fdcd797 commit a6e338e325a03f4d6085e14705d4f93fb5b47e9f @LindseyB committed Mar 13, 2012
Showing with 33 additions and 0 deletions.
  1. +1 −0 Gemfile
  2. +21 −0 Gemfile.lock
  3. +1 −0 README.rdoc
  4. 0 bin/XOmBot
  5. +10 −0 lib/xombot/plugins/tweet.rb
View
1 Gemfile
@@ -1,3 +1,4 @@
source :rubygems
gem "cinch"
gem "mechanize"
+gem "twitter"
View
21 Gemfile.lock
@@ -1,20 +1,40 @@
GEM
remote: http://rubygems.org/
specs:
+ addressable (2.2.6)
cinch (1.1.3)
domain_name (0.5.2)
unf (~> 0.0.3)
+ faraday (0.7.4)
+ addressable (~> 2.2.6)
+ multipart-post (~> 1.1.0)
+ rack (>= 1.1.0, < 2)
+ faraday_middleware (0.7.0)
+ faraday (~> 0.7.3)
+ hashie (1.1.0)
mechanize (2.1.1)
domain_name (~> 0.5, >= 0.5.1)
net-http-digest_auth (~> 1.1, >= 1.1.1)
net-http-persistent (~> 2.4, >= 2.4.1)
nokogiri (~> 1.4)
ntlm-http (~> 0.1, >= 0.1.1)
webrobots (~> 0.0, >= 0.0.9)
+ multi_json (1.0.4)
+ multi_xml (0.2.2)
+ multipart-post (1.1.3)
net-http-digest_auth (1.2)
net-http-persistent (2.4.1)
nokogiri (1.5.0)
ntlm-http (0.1.1)
+ rack (1.4.1)
+ simple_oauth (0.1.5)
+ twitter (1.6.2)
+ faraday (~> 0.7.4)
+ faraday_middleware (~> 0.7.0)
+ hashie (~> 1.1.0)
+ multi_json (~> 1.0.0)
+ multi_xml (~> 0.2.0)
+ simple_oauth (~> 0.1.5)
unf (0.0.4)
unf_ext
unf_ext (0.0.4)
@@ -26,3 +46,4 @@ PLATFORMS
DEPENDENCIES
cinch
mechanize
+ twitter
View
1 README.rdoc
@@ -13,6 +13,7 @@ Right now XOmBot accepts the following commands:
* !roll [n]d[n][[+|-]n]: rolls several dice with bonuses
* !joke: hear a funny joke
* !answer: get the answer to the last funny joke
+* !tweet [id]: displays the tweet with that id
XOmBot has the following behaviours in addition to the commands:
View
0 bin/XOmBot 100644 → 100755
File mode changed.
View
10 lib/xombot/plugins/tweet.rb
@@ -0,0 +1,10 @@
+class Tweet < XOmBot::Plugin
+ match /tweet (\d+)/
+ help "Displays the tweet with the given id"
+ usage "tweet 12345678 -- displays the twitter update with that id"
+
+ def execute(m, id)
+ status = Twitter.status(id)
+ m.reply "@#{status.user.screen_name}: #{status.text}"
+ end
+end

0 comments on commit a6e338e

Please sign in to comment.