diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/urban.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb index f4355061..68ffadba 100644 --- a/data/rbot/plugins/urban.rb +++ b/data/rbot/plugins/urban.rb @@ -21,7 +21,9 @@ class UrbanPlugin < Plugin notfound = s.match %r{<i>.*?</i> isn't defined} - numpages = s[%r{<div id='paginator'>.*?</div>}m].scan(/\d+/).collect {|x| x.to_i}.max || 1 + numpages = if s[%r{<div id='paginator'>.*?</div>}m] + $&.scan(/\d+/).collect {|x| x.to_i}.max + else 1 end rv = Array.new 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| |