mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-29 06:51:12 -05:00
SpiffyTitles: utils.web._httpUrlRe -> urlRegularExpression
This commit is contained in:
parent
e2da04d81b
commit
2bb455e3c3
@ -37,7 +37,7 @@ import supybot.world as world
|
|||||||
|
|
||||||
# Use this for the version of this plugin. You may wish to put a CVS keyword
|
# Use this for the version of this plugin. You may wish to put a CVS keyword
|
||||||
# in here if you're keeping the plugin in CVS or some similar system.
|
# in here if you're keeping the plugin in CVS or some similar system.
|
||||||
__version__ = "2020.06.06+git"
|
__version__ = "2020.06.25+git"
|
||||||
|
|
||||||
# XXX Replace this with an appropriate author or supybot.Author instance.
|
# XXX Replace this with an appropriate author or supybot.Author instance.
|
||||||
__author__ = supybot.Author("butterscotchstallion", "butterscotchstallion", "")
|
__author__ = supybot.Author("butterscotchstallion", "butterscotchstallion", "")
|
||||||
|
@ -70,8 +70,7 @@ conf.registerChannelValue(
|
|||||||
SpiffyTitles,
|
SpiffyTitles,
|
||||||
"urlRegularExpression",
|
"urlRegularExpression",
|
||||||
registry.String(
|
registry.String(
|
||||||
r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+~]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+",
|
r"", _("""If set, this regular expression will be used to match URLs"""),
|
||||||
_("""This regular expression will be used to match URLs"""),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -560,6 +560,8 @@ class SpiffyTitles(callbacks.Plugin):
|
|||||||
Find the first string that looks like a URL from the message
|
Find the first string that looks like a URL from the message
|
||||||
"""
|
"""
|
||||||
url_re = self.registryValue("urlRegularExpression", channel)
|
url_re = self.registryValue("urlRegularExpression", channel)
|
||||||
|
if not url_re:
|
||||||
|
url_re = utils.web._httpUrlRe
|
||||||
matches = re.findall(url_re, input)
|
matches = re.findall(url_re, input)
|
||||||
return matches
|
return matches
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user