- crt = parse(update['created_at']).utctimetuple()
- if (crt > self.lastUpdate):
- self.privmsg_channel(
- "=^_^= %s %s" %(
- update['user']['screen_name'],
- update['text']))
- self.lastUpdate = crt
- else:
- break
+ crt = parsedate(update['created_at'])
+ if (crt > nextLastUpdate):
+ text = (htmlentitydecode(
+ update['text'].replace('\n', ' '))
+ .encode('utf-8', 'replace'))
+
+ # 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_channels(
+ "%s %s%s%s %s" %(
+ get_prefix(),
+ IRC_BOLD, update['user']['screen_name'],
+ IRC_BOLD, text.decode('utf-8')))
+
+ debug("tweet has crt %s, updating nextLastUpdate (was %s)" %(
+ crt, nextLastUpdate,
+ ))
+ nextLastUpdate = crt
+
+ debug("setting self.lastUpdate to %s" % nextLastUpdate)
+ self.lastUpdate = nextLastUpdate