mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Web: Make choice of displayed domain (origin/target) configurable.
This commit is contained in:
parent
11d8f4655b
commit
289f614bfa
@ -52,6 +52,10 @@ conf.registerChannelValue(Web, 'titleSnarfer',
|
|||||||
conf.registerChannelValue(Web, 'snarferReportIOExceptions',
|
conf.registerChannelValue(Web, 'snarferReportIOExceptions',
|
||||||
registry.Boolean(False, _("""Determines whether the bot will notfiy the user
|
registry.Boolean(False, _("""Determines whether the bot will notfiy the user
|
||||||
about network exceptions like hostnotfound, timeout ....""")))
|
about network exceptions like hostnotfound, timeout ....""")))
|
||||||
|
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, '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
|
||||||
|
@ -151,7 +151,9 @@ class Web(callbacks.PluginRegexp):
|
|||||||
self.log.debug('Encountered a problem parsing %u. Title may '
|
self.log.debug('Encountered a problem parsing %u. Title may '
|
||||||
'already be set, though', url)
|
'already be set, though', url)
|
||||||
if parser.title:
|
if parser.title:
|
||||||
domain = utils.web.getDomain(fd.geturl())
|
domain = utils.web.getDomain(fd.geturl()
|
||||||
|
if self.registryValue('snarferShowTargetDomain', channel)
|
||||||
|
else url)
|
||||||
title = utils.web.htmlToText(parser.title.strip())
|
title = utils.web.htmlToText(parser.title.strip())
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
if isinstance(title, unicode):
|
if isinstance(title, unicode):
|
||||||
|
Loading…
Reference in New Issue
Block a user