- crt = parse(update['created_at']).utctimetuple()
- if (crt > self.lastUpdate):
- text = (
- update['text']
- .replace('\n', ' ')
- .replace(""", "\"")
- .replace('&', '&'))
- self.privmsg_channel(
- "=^_^= %s%s%s %s" %(
- IRC_BOLD, update['user']['screen_name'],
- IRC_BOLD, 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(
+ u"%s %s%s%s %s" %(
+ get_prefix(),
+ IRC_BOLD, update['user']['screen_name'],
+ IRC_BOLD, text.decode('utf-8')))
+
+ nextLastUpdate = crt
+
+ debug("setting self.lastUpdate to %s" % nextLastUpdate)
+ self.lastUpdate = nextLastUpdate