Adding iambuttbot.py plugin to post all buttbot messages to twitter

This commit is contained in:
Alex Vidal 2009-03-16 13:33:59 -05:00
parent d755e4c601
commit cc86e86b85
1 changed files with 15 additions and 0 deletions

15
plugins/iambuttbot.py Normal file
View File

@ -0,0 +1,15 @@
"""
iambuttbot.py: avidal 2009
posts everything buttbot says to the iambuttbot twitter account
"""
import urllib
import hook
@hook.command(hook=r'(.*)')
def iambuttbot(bot, input)
if input.nick.lower() != 'buttbot': return
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)