Strip whitespaces from strings
This commit is contained in:
parent
eb70076565
commit
84b83a9c48
1 changed files with 2 additions and 2 deletions
|
@ -33,14 +33,14 @@ while True:
|
||||||
for status in timeline:
|
for status in timeline:
|
||||||
if status.text.find("@" + user) > 1:
|
if status.text.find("@" + user) > 1:
|
||||||
continue
|
continue
|
||||||
text = status.text.encode("UTF-8")[status.text.find(" ")+1:]
|
text = status.text.encode("UTF-8")[status.text.find(" ")+1:].strip()
|
||||||
sender = status.user.screen_name.encode("UTF-8")
|
sender = status.user.screen_name.encode("UTF-8")
|
||||||
twid = int(status.id)
|
twid = int(status.id)
|
||||||
try:
|
try:
|
||||||
if "-" in text:
|
if "-" in text:
|
||||||
loc = text.find("-")
|
loc = text.find("-")
|
||||||
date = dateutil.parser.parse(text[:loc-1])
|
date = dateutil.parser.parse(text[:loc-1])
|
||||||
comment = HTMLParser.HTMLParser().unescape(text[loc+1:])
|
comment = HTMLParser.HTMLParser().unescape(text[loc+1:]).strip()
|
||||||
else:
|
else:
|
||||||
date = dateutil.parser.parse(text)
|
date = dateutil.parser.parse(text)
|
||||||
comment = ""
|
comment = ""
|
||||||
|
|
Loading…
Reference in a new issue