mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-03 08: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
|
||||
by the snarfer will be the original one (posted on IRC) or the target one
|
||||
(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',
|
||||
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
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
import re
|
||||
import sys
|
||||
import string
|
||||
import socket
|
||||
|
||||
import supybot.conf as conf
|
||||
@ -198,7 +199,8 @@ class Web(callbacks.PluginRegexp):
|
||||
domain = utils.web.getDomain(target
|
||||
if self.registryValue('snarferShowTargetDomain', channel)
|
||||
else url)
|
||||
s = format(_('Title: %s'), title)
|
||||
prefix = self.registryValue('snarferPrefix', channel)
|
||||
s = prefix + title
|
||||
if self.registryValue('snarferShowDomain', channel):
|
||||
s += format(_(' (at %s)'), domain)
|
||||
irc.reply(s, prefixNick=False)
|
||||
|
Loading…
Reference in New Issue
Block a user