summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/urban.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb
index a15b3622..a23f8742 100644
--- a/data/rbot/plugins/urban.rb
+++ b/data/rbot/plugins/urban.rb
@@ -26,8 +26,10 @@ class UrbanPlugin < Plugin
else 1 end
rv = Array.new
- s.scan(%r{<div class='word'[^>]*>.*?<a class="index"[^>]*>.*?(\d+)\..*?</a>.*?<span>(.*?)</span>.*?<div class="definition">(.+?)</div>.*?<div class="example">(.+?)</div>}m) do |num, wrd, desc, ex|
- rv << [num.to_i, wrd.strip, desc.strip, ex.strip]
+ num = 1
+ s.scan(%r{<div class='word'[^>]*>.*?<a href="\/define[^>]*>([^<]+)</a>.*?<div class='meaning'>(.+?)</div>.*?<div class='example'>(.+?)</div>}m) do |wrd, desc, ex|
+ rv << [num, wrd.strip, desc.strip, ex.strip]
+ num += 1
end
maxnum = rv.collect {|x| x[0]}.max || 0