unescape html entities in tweets

workspace
Brendan Howell 8 years ago
parent 2882562354
commit 4150dd685f

@ -1,3 +1,4 @@
import html
import textwrap
import urllib
@ -99,6 +100,7 @@ class PublicRelations(Bureau):
prn._raw(username)
prn.text("\r\n")
prn.set(text_type="NORMAL")
twtext = html.unescape(t["text"])
t_wrapped = textwrap.fill(t["text"], width=48) + "\r\n"
t_enc = t_wrapped.encode("cp437", "ignore")
prn._raw(t_enc)

Loading…
Cancel
Save