diff --git a/app.py b/app.py index 24c563e..fbc9d55 100644 --- a/app.py +++ b/app.py @@ -18,5 +18,7 @@ def toot(): toot_content = request.data if(toot_content == None): return "No content, aborting" + toot_content = toot_content.decode("utf-8") + print(toot_content) print(mastodon.status_post(toot_content, spoiler_text="Musique")) return "Tooted !" \ No newline at end of file diff --git a/deezer-tooter/browserAction/script.js b/deezer-tooter/browserAction/script.js index 7fef49c..aecb798 100644 --- a/deezer-tooter/browserAction/script.js +++ b/deezer-tooter/browserAction/script.js @@ -7,7 +7,7 @@ function tootInfo(message) { url = "http://localhost:5000/toot" fetch(url, { method: 'POST', - body: JSON.stringify(tootContent), + body: tootContent }) .then(function (response) { return response.json(); @@ -18,8 +18,8 @@ function tootInfo(message) { } function handleResponse(message) { - document.getElementById("toot-info").innerHTML = message.artist + " - " + message.title - document.getElementById("toot-hashtags").value = "#radio #np #musique #music" + document.getElementById("toot-info").innerHTML = message.artist + " - " + message.title + '\n\n' + document.getElementById("toot-hashtags").value = "#radio #np #musique #music" + '\n' } function handleError(error) {