Escape translated string before tweeting

This commit is contained in:
Klaus-Uwe Mitterer 2017-03-10 09:12:57 +01:00
parent 3e541c5224
commit ee9c3426ff

View file

@ -49,7 +49,7 @@ for status in timeline:
tstring = translator.translate(intext, target_language=a[0])['translatedText'].replace("@", "@")
try:
two.tweet(tstring[:140])
two.tweet(html.parser.HTMLParser().unescape(tstring[:140]))
tw_counter += 1
except Exception as e:
print(e)