mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-09 11:04:07 +01:00
Add variable supybot.plugins.Web.snarferPrefix.
This commit is contained in:
parent
c930edd943
commit
e2180a1e08
@ -59,6 +59,9 @@ conf.registerChannelValue(Web, 'snarferShowTargetDomain',
|
|||||||
registry.Boolean(False, _("""Determines whether the domain name displayed
|
registry.Boolean(False, _("""Determines whether the domain name displayed
|
||||||
by the snarfer will be the original one (posted on IRC) or the target one
|
by the snarfer will be the original one (posted on IRC) or the target one
|
||||||
(got after following redirects, if any).""")))
|
(got after following redirects, if any).""")))
|
||||||
|
conf.registerChannelValue(Web, 'snarferPrefix',
|
||||||
|
registry.String(_('Title: '), _("""Determines the string used at before
|
||||||
|
a web page's title.""")))
|
||||||
conf.registerChannelValue(Web, 'nonSnarfingRegexp',
|
conf.registerChannelValue(Web, 'nonSnarfingRegexp',
|
||||||
registry.Regexp(None, _("""Determines what URLs matching the given regexp
|
registry.Regexp(None, _("""Determines what URLs matching the given regexp
|
||||||
will not be snarfed. Give the empty string if you have no URLs that you'd
|
will not be snarfed. Give the empty string if you have no URLs that you'd
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import string
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
@ -198,7 +199,8 @@ class Web(callbacks.PluginRegexp):
|
|||||||
domain = utils.web.getDomain(target
|
domain = utils.web.getDomain(target
|
||||||
if self.registryValue('snarferShowTargetDomain', channel)
|
if self.registryValue('snarferShowTargetDomain', channel)
|
||||||
else url)
|
else url)
|
||||||
s = format(_('Title: %s'), title)
|
prefix = self.registryValue('snarferPrefix', channel)
|
||||||
|
s = prefix + title
|
||||||
if self.registryValue('snarferShowDomain', channel):
|
if self.registryValue('snarferShowDomain', channel):
|
||||||
s += format(_(' (at %s)'), domain)
|
s += format(_(' (at %s)'), domain)
|
||||||
irc.reply(s, prefixNick=False)
|
irc.reply(s, prefixNick=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user