X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Furban.rb;h=d66883060ea823dcaa394a4362dff6cef53c5460;hb=052217de30c59206d7025b582d4604557a747470;hp=98066e60077fae7e87e26e96cbcad68751f452c8;hpb=e57295d1ff47aacc88257ee1a1f0c615d63d886b;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/urban.rb b/data/rbot/plugins/urban.rb index 98066e60..d6688306 100644 --- a/data/rbot/plugins/urban.rb +++ b/data/rbot/plugins/urban.rb @@ -13,36 +13,35 @@ class UrbanPlugin < Plugin def get_def(m, word, n = nil) n = n ? n.to_i : 1 + p = (n-1)/7 + 1 u = URBAN + URI.escape(word) - u += '&skip=' + n.to_s if n + u += '&page=' + p.to_s if p > 1 s = @bot.httputil.get(u) + return m.reply("Couldn't get the urban dictionary definition for #{word}") if s.nil? - notfound = s.match %r{
(.+?)
.*?(.+?)