From ee9c3426fff626f7a31af21ae156f21cdda06fe0 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Fri, 10 Mar 2017 09:12:57 +0100 Subject: [PATCH] Escape translated string before tweeting --- transbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transbot.py b/transbot.py index 0146811..f9e3faa 100755 --- a/transbot.py +++ b/transbot.py @@ -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)