X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/6da3627e857d0a923b5f44de90e339ab51f173f2..7f6c5ae3ec7a7ac9d77b8dd90fcb8cc46092e1b1:/twitter/ircbot.py diff --git a/twitter/ircbot.py b/twitter/ircbot.py index f702b79..1025057 100644 --- a/twitter/ircbot.py +++ b/twitter/ircbot.py @@ -27,9 +27,7 @@ password: """ -# TODO add delimiter if first word isn't "is" or "was" - -BOT_VERSION = "TwitterBot 0.2.1 (mike.verdone.ca/twitter)" +BOT_VERSION = "TwitterBot 0.3.1 (mike.verdone.ca/twitter)" IRC_BOLD = chr(0x02) IRC_ITALIC = chr(0x16) @@ -130,10 +128,16 @@ class TwitterBot(object): text = (htmlentitydecode( update['text'].replace('\n', ' ')) .encode('utf-8', 'replace')) - self.privmsg_channel( - "=^_^= %s%s%s %s" %( - IRC_BOLD, update['user']['screen_name'], - IRC_BOLD, text)) + + # Skip updates beginning with @ + # TODO This would be better if we only ignored messages + # to people who are not on our following list. + if not text.startswith("@"): + self.privmsg_channel( + "=^_^= %s%s%s %s" %( + IRC_BOLD, update['user']['screen_name'], + IRC_BOLD, text)) + nextLastUpdate = crt else: break