mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +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',
|
||||
registry.Boolean(False, _("""Determines whether the bot will notfiy the user
|
||||
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',
|
||||
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
|
||||
|
@ -151,7 +151,9 @@ class Web(callbacks.PluginRegexp):
|
||||
self.log.debug('Encountered a problem parsing %u. Title may '
|
||||
'already be set, though', url)
|
||||
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())
|
||||
if sys.version_info[0] < 3:
|
||||
if isinstance(title, unicode):
|
||||
|
Loading…
Reference in New Issue
Block a user