unescape html entities in tweets

workspace
Brendan Howell 8 years ago
parent 2882562354
commit 4150dd685f

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

Loading…
Cancel
Save