X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Furban.rb;h=70d451af7788d5848dbfca074367a0e350859d61;hb=ac8529c8370bd6dbcb0947bc14e1cc2117826a29;hp=d66883060ea823dcaa394a4362dff6cef53c5460;hpb=12a508e1a75bc1de501f36ca9e4767f2349fe12e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb index d6688306..70d451af 100644 --- a/data/rbot/plugins/urban.rb +++ b/data/rbot/plugins/urban.rb @@ -21,13 +21,15 @@ class UrbanPlugin < Plugin notfound = s.match %r{.*? isn't defined} - numpages = if s[%r{
.*?
}m] - $&.scan(/\d+/).collect {|x| x.to_i}.max || 1 + numpages = if s[%r{}m] + $&.scan(/>(\d+)]*>.*?(\d+)\..*?.*?(?:)?([^>]+)(?:)?.*?
(.+?)
.*?
(.+?)
}m) do |num, wrd, desc, ex| - rv << [num.to_i, wrd.strip, desc.strip, ex.strip] + num = 1 + s.scan(%r{]* href="\/define[^>]*>([^<]+).*?
(.+?)
.*?
(.+?)
}m) do |wrd, desc, ex| + rv << [num, wrd.strip, desc.strip, ex.strip] + num += 1 end maxnum = rv.collect {|x| x[0]}.max || 0