Improve handling of incoming tweets...

This commit is contained in:
Klaus-Uwe Mitterer 2015-03-18 23:14:27 +01:00
parent 416b5b8e37
commit a66f815916

View file

@ -38,8 +38,9 @@ while True:
twid = int(status.id)
try:
if "-" in text:
date = dateutil.parser.parse(text.split("-")[0])
comment = HTMLParser.HTMLParser().unescape(text.split("-")[1])
loc = text.find("-")
date = dateutil.parser.parse(text[:loc-1])
comment = HTMLParser.HTMLParser().unescape(text[loc+1:])
else:
date = dateutil.parser.parse(text)
comment = ""