aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Terry 2019-03-29 11:21:07 -0300
committerLibravatar Terry 2019-03-29 11:21:07 -0300
commitade6f8d048fda93544f028e5e8af3b4e4f3d4db8 (patch)
tree1e31a9d411f131bedafba6211b278d651c16a500
parentaba26b4a8731a3485eba3d0a7d0d1d3f2401ac66 (diff)
parentcb6cb9cda955d3507cb71a9e146443fb8af53136 (diff)
downloadweabot-ade6f8d048fda93544f028e5e8af3b4e4f3d4db8.tar.gz
weabot-ade6f8d048fda93544f028e5e8af3b4e4f3d4db8.tar.xz
weabot-ade6f8d048fda93544f028e5e8af3b4e4f3d4db8.zip
Merge branch 'master' of https://git.bienvenidoainternet.org/priv/www
-rw-r--r--cgi/post.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cgi/post.py b/cgi/post.py
index 2c14004..4d4c598 100644
--- a/cgi/post.py
+++ b/cgi/post.py
@@ -1242,19 +1242,19 @@ def discord_hook(post, url):
"embeds": [{
"title": post['subject'],
"description": cut_home_msg(post['message'], 30),
- "url": "https://bienvenidoainternet.org" + url,
+ "url": "https://bienvenidoainternet.org" + url, # TODO: Parametrizar.
"color": 11910504,
"timestamp": datetime.datetime.utcfromtimestamp(post['timestamp']).isoformat(),
"footer": { "text": board['name'] },
- "thumbnail": { "url": "https://bienvenidoainternet.org/%s/thumb/%s" % (board['dir'], post['thumb']) },
+ "thumbnail": { "url": "%s%s/thumb/%s" % (Settings.HOME_URL, board['dir'], post['thumb']) },
"author": {
"name": "Nuevo hilo",
- "icon_url": "https://bienvenidoainternet.org/0/junk/w/shobon.gif"
+ "icon_url": "%s0/junk/w/shobon.gif" % Settings.HOME_URL
}}]
}
jsondata = json.dumps(data, separators=(',',':'))
opener = urllib2.build_opener()
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0')]
- response = opener.open(WEBHOOK_URL, jsondata, 6)
+ response = opener.open(Settings.DISCORD_HOOK_URL, jsondata, 6)
the_page = response.read()