From fd47891b553533db2b3cbec0e568c183de7b3468 Mon Sep 17 00:00:00 2001 From: amd64fox <62529699+amd64fox@users.noreply.github.com> Date: Mon, 2 Sep 2024 22:40:16 +0300 Subject: [PATCH] Create goofyHistory.js --- js-helper/goofyHistory.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 js-helper/goofyHistory.js diff --git a/js-helper/goofyHistory.js b/js-helper/goofyHistory.js new file mode 100644 index 0000000..1bf2265 --- /dev/null +++ b/js-helper/goofyHistory.js @@ -0,0 +1,20 @@ +const unique = new Set(); + +function Gofy_history(e, urlForm, idBox) { + + const uri = e?.item?.uri; + + if (uri && uri.includes('spotify:track:') && !unique.has(uri)) { + + unique.add(uri); + + fetch(urlForm, { + "headers": { + "content-type": "application/x-www-form-urlencoded", + }, + "body": "entry." + idBox + "=" + uri, + "method": "POST", + "mode": "no-cors", + }).catch(error => console.error('error sending uri to google form:', error)); + } +} \ No newline at end of file