Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Decode html entities from tweets

  • Loading branch information...
commit ad68acc12efcba9b4ab998c68f61e4015e3dccd6 1 parent a36eb1e
Lindsey Bieda authored

Showing 3 changed files with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 0  Gemfile
  2. +2 0  Gemfile.lock
  3. +2 2 lib/xombot/plugins/tweet.rb
1  Gemfile
@@ -2,3 +2,4 @@ source :rubygems
2 2 gem "cinch"
3 3 gem "mechanize"
4 4 gem "twitter"
  5 +gem "htmlentities"
2  Gemfile.lock
@@ -12,6 +12,7 @@ GEM
12 12 faraday_middleware (0.7.0)
13 13 faraday (~> 0.7.3)
14 14 hashie (1.1.0)
  15 + htmlentities (4.3.1)
15 16 mechanize (2.1.1)
16 17 domain_name (~> 0.5, >= 0.5.1)
17 18 net-http-digest_auth (~> 1.1, >= 1.1.1)
@@ -45,5 +46,6 @@ PLATFORMS
45 46
46 47 DEPENDENCIES
47 48 cinch
  49 + htmlentities
48 50 mechanize
49 51 twitter
4 lib/xombot/plugins/tweet.rb
@@ -9,10 +9,10 @@ class Tweet < XOmBot::Plugin
9 9
10 10 def tweet_by_id(m, id)
11 11 status = Twitter.status(id)
12   - m.reply "@#{status.user.screen_name}: #{status.text}"
  12 + m.reply "@#{status.user.screen_name}: #{HTMLEntities.new.decode status.text}"
13 13 end
14 14
15 15 def tweet_by_username(m, username)
16   - m.reply "@#{username}: #{Twitter.user_timeline(username).first.text}"
  16 + m.reply "@#{username}: #{HTMLEntities.new.decode Twitter.user_timeline(username).first.text}"
17 17 end
18 18 end

0 comments on commit ad68acc

Please sign in to comment.
Something went wrong with that request. Please try again.