From d676eaa77fa561f31e8beea49a4095ec6cfbe6f0 Mon Sep 17 00:00:00 2001 From: Mispy <^_^@mispy.me> Date: Sun, 20 Apr 2014 06:17:48 -0700 Subject: [PATCH] 2.2.1 - Handle mentions at end of string --- README.md | 2 +- lib/twitter_ebooks/bot.rb | 2 +- lib/twitter_ebooks/version.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2aaf737..b8ca4ed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# twitter\_ebooks 2.2.0 +# twitter\_ebooks 2.2.1 Rewrite of my twitter\_ebooks code. While the original was solely a tweeting Markov generator, this framework helps you build any kind of interactive twitterbot which responds to mentions/DMs. diff --git a/lib/twitter_ebooks/bot.rb b/lib/twitter_ebooks/bot.rb index 6a69689..5eb8b9e 100644 --- a/lib/twitter_ebooks/bot.rb +++ b/lib/twitter_ebooks/bot.rb @@ -103,7 +103,7 @@ module Ebooks mless = ev[:text] begin ev.attrs[:entities][:user_mentions].reverse.each do |entity| - mless = mless[0...entity[:indices][0]] + mless[entity[:indices][1]+1..-1] + mless = mless[0...entity[:indices][0]] + mless[entity[:indices][1]..-1].strip end rescue Exception p ev.attrs[:entities][:user_mentions] diff --git a/lib/twitter_ebooks/version.rb b/lib/twitter_ebooks/version.rb index ee41324..fa8f7c3 100644 --- a/lib/twitter_ebooks/version.rb +++ b/lib/twitter_ebooks/version.rb @@ -1,3 +1,3 @@ module Ebooks - VERSION = "2.2.0" + VERSION = "2.2.1" end