mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Changed the default of the snarfer, added a question to configure.
This commit is contained in:
parent
2a5cc04749
commit
fb4a4ffca7
@ -72,13 +72,12 @@ class BugzillaError(Exception):
|
|||||||
def configure(onStart, afterConnect, advanced):
|
def configure(onStart, afterConnect, advanced):
|
||||||
from questions import expect, anything, yn
|
from questions import expect, anything, yn
|
||||||
onStart.append('load Bugzilla')
|
onStart.append('load Bugzilla')
|
||||||
if advanced:
|
|
||||||
print 'The Bugzilla plugin has the functionality to watch for URLs'
|
print 'The Bugzilla plugin has the functionality to watch for URLs'
|
||||||
print 'that match a specific pattern (we call this a snarfer). When'
|
print 'that match a specific pattern (we call this a snarfer). When'
|
||||||
print 'supybot sees such a URL, he will parse the web page for'
|
print 'supybot sees such a URL, he will parse the web page for'
|
||||||
print 'information and reply with the results.\n'
|
print 'information and reply with the results.\n'
|
||||||
if yn('Do you want the Bugzilla snarfer enabled by default?') == 'n':
|
if yn('Do you want this bug snarfer enabled by default?') == 'y':
|
||||||
onStart.append('Bugzilla config bug-snarfer off')
|
onStart.append('Bugzilla config bug-snarfer on')
|
||||||
|
|
||||||
replyNoBugzilla = 'I don\'t have a bugzilla %r'
|
replyNoBugzilla = 'I don\'t have a bugzilla %r'
|
||||||
|
|
||||||
@ -87,7 +86,7 @@ class Bugzilla(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
|
|||||||
threaded = True
|
threaded = True
|
||||||
regexps = ['bzSnarfer']
|
regexps = ['bzSnarfer']
|
||||||
configurables = plugins.ConfigurableDictionary(
|
configurables = plugins.ConfigurableDictionary(
|
||||||
[('bug-snarfer', plugins.ConfigurableBoolType, True,
|
[('bug-snarfer', plugins.ConfigurableBoolType, False,
|
||||||
"""Determines whether the bug snarfer will be enabled, such that any
|
"""Determines whether the bug snarfer will be enabled, such that any
|
||||||
Bugzilla URLs seen in the channel will have their information reported
|
Bugzilla URLs seen in the channel will have their information reported
|
||||||
into the channel.""")]
|
into the channel.""")]
|
||||||
|
@ -61,8 +61,8 @@ def configure(onStart, afterConnect, advanced):
|
|||||||
print 'that match a specific pattern (we call this a snarfer). When'
|
print 'that match a specific pattern (we call this a snarfer). When'
|
||||||
print 'supybot sees such a URL, he will parse the web page for'
|
print 'supybot sees such a URL, he will parse the web page for'
|
||||||
print 'information and reply with the results.\n'
|
print 'information and reply with the results.\n'
|
||||||
if yn('Do you want the Ebay snarfer enabled by default?') == 'n':
|
if yn('Do you want the Ebay snarfer enabled by default?') == 'y':
|
||||||
onStart.append('Ebay config auction-snarfer off')
|
onStart.append('Ebay config auction-snarfer on')
|
||||||
|
|
||||||
class EbayError(callbacks.Error):
|
class EbayError(callbacks.Error):
|
||||||
pass
|
pass
|
||||||
@ -75,7 +75,7 @@ class Ebay(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
|
|||||||
threaded = True
|
threaded = True
|
||||||
regexps = ['ebaySnarfer']
|
regexps = ['ebaySnarfer']
|
||||||
configurables = plugins.ConfigurableDictionary(
|
configurables = plugins.ConfigurableDictionary(
|
||||||
[('auction-snarfer', plugins.ConfigurableBoolType, True,
|
[('auction-snarfer', plugins.ConfigurableBoolType, False,
|
||||||
"""Determines whether the bot will automatically 'snarf' Ebay auction
|
"""Determines whether the bot will automatically 'snarf' Ebay auction
|
||||||
URLs and print information about them.""")]
|
URLs and print information about them.""")]
|
||||||
)
|
)
|
||||||
|
@ -72,12 +72,14 @@ def configure(onStart, afterConnect, advanced):
|
|||||||
print 'The Google plugin has the functionality to watch for URLs'
|
print 'The Google plugin has the functionality to watch for URLs'
|
||||||
print 'that match a specific pattern (we call this a snarfer).'
|
print 'that match a specific pattern (we call this a snarfer).'
|
||||||
print 'When supybot sees such a URL, he will parse the web page'
|
print 'When supybot sees such a URL, he will parse the web page'
|
||||||
print 'for information and reply with the results.\n'
|
print 'for information and reply with the results.'
|
||||||
|
print
|
||||||
print 'Google has two available snarfers: Google Groups link'
|
print 'Google has two available snarfers: Google Groups link'
|
||||||
print 'snarfing and a google search snarfer.\n'
|
print 'snarfing and a google search snarfer.'
|
||||||
|
print
|
||||||
if yn('Do you want the Google Groups link snarfer enabled by '
|
if yn('Do you want the Google Groups link snarfer enabled by '
|
||||||
'default?') == 'n':
|
'default?') == 'y':
|
||||||
onStart.append('Google config groups-snarfer off')
|
onStart.append('Google config groups-snarfer on')
|
||||||
if yn('Do you want the Google search snarfer enabled by default?')\
|
if yn('Do you want the Google search snarfer enabled by default?')\
|
||||||
== 'y':
|
== 'y':
|
||||||
onStart.append('Google config search-snarfer on')
|
onStart.append('Google config search-snarfer on')
|
||||||
@ -122,7 +124,7 @@ class Google(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
|
|||||||
threaded = True
|
threaded = True
|
||||||
regexps = sets.Set(['googleSnarfer', 'googleGroups'])
|
regexps = sets.Set(['googleSnarfer', 'googleGroups'])
|
||||||
configurables = plugins.ConfigurableDictionary(
|
configurables = plugins.ConfigurableDictionary(
|
||||||
[('groups-snarfer', plugins.ConfigurableBoolType, True,
|
[('groups-snarfer', plugins.ConfigurableBoolType, False,
|
||||||
"""Determines whether the groups snarfer is enabled. If so, URLs at
|
"""Determines whether the groups snarfer is enabled. If so, URLs at
|
||||||
groups.google.com will be snarfed and their group/title messaged to
|
groups.google.com will be snarfed and their group/title messaged to
|
||||||
the channel."""),
|
the channel."""),
|
||||||
|
@ -69,12 +69,16 @@ def configure(onStart, afterConnect, advanced):
|
|||||||
# commands you would like to be run when the bot has finished connecting.
|
# commands you would like to be run when the bot has finished connecting.
|
||||||
from questions import expect, anything, something, yn
|
from questions import expect, anything, something, yn
|
||||||
onStart.append('load Python')
|
onStart.append('load Python')
|
||||||
|
if yn("""This plugin provides a snarfer for ASPN Python Recipe URLs;
|
||||||
|
it will output the name of the Recipe when it sees such a URL.
|
||||||
|
Would you like to enable this snarfer?""") == 'y':
|
||||||
|
onStart.append('python config aspn-snarfer on')
|
||||||
|
|
||||||
class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
|
class Python(callbacks.PrivmsgCommandAndRegexp, plugins.Configurable):
|
||||||
modulechars = '%s%s%s' % (string.ascii_letters, string.digits, '_.')
|
modulechars = '%s%s%s' % (string.ascii_letters, string.digits, '_.')
|
||||||
regexps = ['aspnRecipes']
|
regexps = ['aspnRecipes']
|
||||||
configurables = plugins.ConfigurableDictionary(
|
configurables = plugins.ConfigurableDictionary(
|
||||||
[('aspn-snarfer', plugins.ConfigurableBoolType, True,
|
[('aspn-snarfer', plugins.ConfigurableBoolType, False,
|
||||||
"""Determines whether the ASPN Python recipe snarfer is enabled. If
|
"""Determines whether the ASPN Python recipe snarfer is enabled. If
|
||||||
so, it will message the channel with the name of the recipe when it
|
so, it will message the channel with the name of the recipe when it
|
||||||
sees an ASPN Python recipe link on the channel.""")]
|
sees an ASPN Python recipe link on the channel.""")]
|
||||||
|
@ -61,13 +61,31 @@ def configure(onStart, afterConnect, advanced):
|
|||||||
# commands you would like to be run when the bot has finished connecting.
|
# commands you would like to be run when the bot has finished connecting.
|
||||||
from questions import expect, anything, something, yn
|
from questions import expect, anything, something, yn
|
||||||
onStart.append('load URL')
|
onStart.append('load URL')
|
||||||
|
if yn("""This plugin offers a snarfer that will go to tinyurl.com and get
|
||||||
|
a shorter version of long URLs that are sent to the channel.
|
||||||
|
Would you like this snarfer to be enabled?""") == 'y':
|
||||||
|
onStart.append('url config tinyurl-snarfer on')
|
||||||
|
if advanced:
|
||||||
|
x = anything("""What would you like to be the minimum URL length
|
||||||
|
that will trigger this snarfer?""")
|
||||||
|
if not x:
|
||||||
|
x = '46'
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
i = int(x)
|
||||||
|
onStart.append('url config tinyurl-minimum-length %s' % i)
|
||||||
|
return
|
||||||
|
except ValueError:
|
||||||
|
print 'That\'s not a valid integer.'
|
||||||
|
x = anything("""What would you like to be the minimum URL
|
||||||
|
length that will trigger this snarfer?""")
|
||||||
|
|
||||||
class URL(callbacks.PrivmsgCommandAndRegexp,
|
class URL(callbacks.PrivmsgCommandAndRegexp,
|
||||||
plugins.Configurable,
|
plugins.Configurable,
|
||||||
plugins.ChannelDBHandler):
|
plugins.ChannelDBHandler):
|
||||||
regexps = ['tinyurlSnarfer']
|
regexps = ['tinyurlSnarfer']
|
||||||
configurables = plugins.ConfigurableDictionary(
|
configurables = plugins.ConfigurableDictionary(
|
||||||
[('tinyurl-snarfer', plugins.ConfigurableBoolType, True,
|
[('tinyurl-snarfer', plugins.ConfigurableBoolType, False,
|
||||||
"""Determines whether the bot will output shorter versions of URLs
|
"""Determines whether the bot will output shorter versions of URLs
|
||||||
longer than the tinyurl-minimum-length config variable."""),
|
longer than the tinyurl-minimum-length config variable."""),
|
||||||
('tinyurl-minimum-length', plugins.ConfigurableIntType, 46,
|
('tinyurl-minimum-length', plugins.ConfigurableIntType, 46,
|
||||||
|
Loading…
Reference in New Issue
Block a user