summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSpencer RInehart <anubis@localhost.localdomain>2008-06-23 16:05:18 -0400
committerdmitry kim <jason@nichego.net>2008-06-23 23:57:23 +0400
commit3b83d8870cc04a2b0eff4250dd8deef9ea1d697b (patch)
tree21ecca56c528ea6c83929d183a18b70d986be651 /data
parent42e2e54f019f8b767b56f9848a1c4b47b6477279 (diff)
Urban can now grab the first page of definitions.
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/urban.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb
index 98066e60..a24ac072 100644
--- a/data/rbot/plugins/urban.rb
+++ b/data/rbot/plugins/urban.rb
@@ -26,8 +26,8 @@ class UrbanPlugin < Plugin
rv = Array.new
- s.scan(%r{<td class="def_number"[^>]*>(\d+)\.</td>.*?<td class="def_word">(?:<a.*?>)?([^>]+)(?:</a>)?</td>.*?<div class="def_p">.*?<p>(.+?)</p>.*?<p style=".*?>(.+?)</p>}m) do |num, wrd, desc, ex|
- rv << [num.to_i, wrd, desc, ex]
+ s.scan(%r{<td class='index'[^>]*>.*?(\d+)\..*?</td>.*?<td class='word'>(?:<a.*?>)?([^>]+)(?:</a>)?</td>.*?<div class='definition'>(.+?)</div>.*?<div class='example'>(.+?)</div>}m) do |num, wrd, desc, ex|
+ rv << [num.to_i, wrd.strip, desc.strip, ex.strip]
end
total ||= rv.size