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) twid = int(status.id)
try: try:
if "-" in text: if "-" in text:
date = dateutil.parser.parse(text.split("-")[0]) loc = text.find("-")
comment = HTMLParser.HTMLParser().unescape(text.split("-")[1]) date = dateutil.parser.parse(text[:loc-1])
comment = HTMLParser.HTMLParser().unescape(text[loc+1:])
else: else:
date = dateutil.parser.parse(text) date = dateutil.parser.parse(text)
comment = "" comment = ""