Moved buttbot password to another file, fixed syntax error

This commit is contained in:
Alex Vidal 2009-03-16 13:42:00 -05:00
parent cc86e86b85
commit 5213276d6f
1 changed files with 3 additions and 2 deletions

View File

@ -7,9 +7,10 @@ import urllib
import hook
@hook.command(hook=r'(.*)')
def iambuttbot(bot, input)
def iambuttbot(bot, input):
if input.nick.lower() != 'buttbot': return
buttbot_pass = open('iambuttbot_passwd').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:goonsay@twitter.com/statuses/update.xml", data)
response = urllib.urlopen("http://iambuttbot:%s@twitter.com/statuses/update.xml" % (buttbot_pass,), data)