mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Use utils.web.httpUrlRe for the Web/ShrinkUrl snarfer regexes.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit ca917d3528
)
This commit is contained in:
parent
750fb2ccdc
commit
bb4e09886a
@ -112,7 +112,6 @@ class ShrinkUrl(callbacks.PluginRegexp):
|
||||
return msg
|
||||
|
||||
def shrinkSnarfer(self, irc, msg, match):
|
||||
r"https?://[^\])>\s]{13,}"
|
||||
channel = msg.args[0]
|
||||
if not irc.isChannel(channel):
|
||||
return
|
||||
@ -144,6 +143,7 @@ class ShrinkUrl(callbacks.PluginRegexp):
|
||||
m = irc.reply(s, prefixNick=False)
|
||||
m.tag('shrunken')
|
||||
shrinkSnarfer = urlSnarfer(shrinkSnarfer)
|
||||
shrinkSnarfer.__doc__ = utils.web.httpUrlRe
|
||||
|
||||
def _getLnUrl(self, url):
|
||||
url = utils.web.urlquote(url)
|
||||
|
@ -1,5 +1,6 @@
|
||||
###
|
||||
# Copyright (c) 2005, Jeremiah Fincher
|
||||
# Copyright (c) 2009, James Vega
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -75,7 +76,6 @@ class Web(callbacks.PluginRegexp):
|
||||
irc.reply(str(e))
|
||||
|
||||
def titleSnarfer(self, irc, msg, match):
|
||||
r"https?://[^\])>\s]+"
|
||||
channel = msg.args[0]
|
||||
if not irc.isChannel(channel):
|
||||
return
|
||||
@ -105,6 +105,7 @@ class Web(callbacks.PluginRegexp):
|
||||
s = format('Title: %s (at %s)', title, domain)
|
||||
irc.reply(s, prefixNick=False)
|
||||
titleSnarfer = urlSnarfer(titleSnarfer)
|
||||
titleSnarfer.__doc__ = utils.web.httpUrlRe
|
||||
|
||||
def headers(self, irc, msg, args, url):
|
||||
"""<url>
|
||||
|
Loading…
Reference in New Issue
Block a user