]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
search plugin: handle image in results
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 24 Sep 2009 20:47:27 +0000 (22:47 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 24 Sep 2009 20:47:27 +0000 (22:47 +0200)
Some results from Google can contain <img> tags as their 'text' part, so
use the new ircify_html feature to display them.

data/rbot/plugins/search.rb

index e7712f7723213067a17edeccff3bb4c96e739a72..aec8b1345611a2994a23f711e3573664ed7c6f81 100644 (file)
@@ -103,7 +103,7 @@ class SearchPlugin < Plugin
     n = 0
     results = results[0...hits].map { |res|
       n += 1
-      t = Utils.decode_html_entities res[2].gsub(filter, '').strip
+      t = res[2].ircify_html(:img => "[%{src} %{alt} %{dimensions}]").strip
       u = URI.unescape(res[0] || res[1])
       urls.push(u)
       "%{n}%{b}%{t}%{b}%{sep}%{u}" % {