fixing hook, iambuttbot
This commit is contained in:
parent
5213276d6f
commit
4b749762cd
|
@ -18,7 +18,7 @@ def sieve(func):
|
|||
_hook_add(func, ['sieve', (_make_sig(func), func)])
|
||||
return func
|
||||
|
||||
def command(func, hook=None, **kwargs):
|
||||
def command(func=None, hook=None, **kwargs):
|
||||
args = {}
|
||||
def command_wrapper(func):
|
||||
if func.func_code.co_argcount not in (1, 2):
|
||||
|
|
|
@ -6,11 +6,13 @@ posts everything buttbot says to the iambuttbot twitter account
|
|||
import urllib
|
||||
import hook
|
||||
|
||||
@hook.command(hook=r'(.*)')
|
||||
@hook.command(hook=r'(.*)', prefix=False)
|
||||
def iambuttbot(bot, input):
|
||||
if input.nick.lower() != 'buttbot': return
|
||||
|
||||
buttbot_pass = open('iambuttbot_passwd').readlines()[0].strip()
|
||||
if input.nick.lower() != 'buttbot':
|
||||
return
|
||||
|
||||
password = open('iambuttbot_password').readlines()[0].strip()
|
||||
status = input.inp if len(input.inp) <= 140 else input.inp[:137] + "..."
|
||||
data = urllib.urlencode({"status": status})
|
||||
response = urllib.urlopen("http://iambuttbot:%s@twitter.com/statuses/update.xml" % (buttbot_pass,), data)
|
||||
url = 'http://iambuttbot:%s@twitter.com/statuses/update.xml' % password
|
||||
response = urllib.urlopen(url, data)
|
||||
|
|
Loading…
Reference in New Issue