From cc86e86b852f35b7a564336d71e45233c59b0bf8 Mon Sep 17 00:00:00 2001 From: Alex Vidal Date: Mon, 16 Mar 2009 13:33:59 -0500 Subject: [PATCH] Adding iambuttbot.py plugin to post all buttbot messages to twitter --- plugins/iambuttbot.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/iambuttbot.py diff --git a/plugins/iambuttbot.py b/plugins/iambuttbot.py new file mode 100644 index 0000000..4e03c2d --- /dev/null +++ b/plugins/iambuttbot.py @@ -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)