projects
/
hamn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff30457
)
HTML un-escape Twitter messages.
author
Dave Page
<dpage@pgadmin.org>
Thu, 24 Aug 2023 09:02:52 +0000
(10:02 +0100)
committer
Dave Page
<dpage@pgadmin.org>
Thu, 24 Aug 2023 09:02:52 +0000
(10:02 +0100)
posttotwitter.py
patch
|
blob
|
blame
|
history
diff --git
a/posttotwitter.py
b/posttotwitter.py
index 528b337029e7fa84ef150d7c0c3ce462759dccde..bb1b3d620303ad8765d6543f58c99311f84e211f 100755
(executable)
--- a/
posttotwitter.py
+++ b/
posttotwitter.py
@@
-13,6
+13,7
@@
Copyright (C) 2009-2019 PostgreSQL Global Development Group
import psycopg2
import psycopg2.extensions
import configparser
+import html
import requests_oauthlib
@@
-35,7
+36,7
@@
class PostToTwitter(object):
Actually make a post to twitter!
"""
r = self.tw.post('https://api.twitter.com/2/tweets', json={
- 'text':
msg
,
+ 'text':
html.unescape(msg)
,
})
if r.status_code != 201:
raise Exception("Could not post to twitter, status code {0}, error {1}".format(r.status_code, r.text))