Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Sanitizing titles for URLAnnounce.

  • Loading branch information...
commit 6a8d60814f2e0da0b67e0220c1dad6dda02dd7cb 1 parent 4719264
@wilkie wilkie authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/xombot/plugins/url_announce.rb
View
2  lib/xombot/plugins/url_announce.rb
@@ -4,7 +4,7 @@ class URLAnnounce < XOmBot::Plugin
def listen(m)
m.message.scan /https?:\/\/[\S]+/ do |url|
page = Mechanize.new.get url
- m.reply "Title: #{page.title}"
+ m.reply "Title: #{page.title.gsub(/\t|\r|\n/, " ").strip}"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.