Improve handling of incoming tweets...
This commit is contained in:
parent
416b5b8e37
commit
a66f815916
1 changed files with 3 additions and 2 deletions
|
@ -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 = ""
|
||||
|
|
Loading…
Reference in a new issue