fixed utf-8 decoding of toot content
This commit is contained in:
parent
4fc2a6c50f
commit
a4a9163efc
2
app.py
2
app.py
@ -18,5 +18,7 @@ def toot():
|
|||||||
toot_content = request.data
|
toot_content = request.data
|
||||||
if(toot_content == None):
|
if(toot_content == None):
|
||||||
return "No content, aborting"
|
return "No content, aborting"
|
||||||
|
toot_content = toot_content.decode("utf-8")
|
||||||
|
print(toot_content)
|
||||||
print(mastodon.status_post(toot_content, spoiler_text="Musique"))
|
print(mastodon.status_post(toot_content, spoiler_text="Musique"))
|
||||||
return "Tooted !"
|
return "Tooted !"
|
@ -7,7 +7,7 @@ function tootInfo(message) {
|
|||||||
url = "http://localhost:5000/toot"
|
url = "http://localhost:5000/toot"
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(tootContent),
|
body: tootContent
|
||||||
})
|
})
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
return response.json();
|
return response.json();
|
||||||
@ -18,8 +18,8 @@ function tootInfo(message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleResponse(message) {
|
function handleResponse(message) {
|
||||||
document.getElementById("toot-info").innerHTML = message.artist + " - " + message.title
|
document.getElementById("toot-info").innerHTML = message.artist + " - " + message.title + '\n\n'
|
||||||
document.getElementById("toot-hashtags").value = "#radio #np #musique #music"
|
document.getElementById("toot-hashtags").value = "#radio #np #musique #music" + '\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleError(error) {
|
function handleError(error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user