mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Use utils.web.httpUrlRe for the Web/ShrinkUrl snarfer regexes.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
22b3ccfbde
commit
ca917d3528
@ -107,7 +107,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
|
||||
@ -139,6 +138,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