From d372ec5babdbf5e6a9c49b21d16bcae74d0ff01c Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 17 Aug 2010 09:24:12 +0200 Subject: search: skip non-search-results link This prevents the regexp scan to grab the Google Privacy link when no results were found. --- data/rbot/plugins/search.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/rbot/plugins/search.rb b/data/rbot/plugins/search.rb index aec8b134..8b3b6848 100644 --- a/data/rbot/plugins/search.rb +++ b/data/rbot/plugins/search.rb @@ -90,7 +90,7 @@ class SearchPlugin < Plugin m.reply "error googling for #{what}" return end - results = wml.scan(GOOGLE_WAP_LINK) + results = wml.match('

').pre_match.scan(GOOGLE_WAP_LINK) if results.length == 0 m.reply "no results found for #{what}" -- cgit v1.2.3