// ==UserScript==
// @name Auto POST
// @namespace ivacbd
// @version 1.1
// @description Send POST request every 1s with draggable control panel
// @match [Link]
// @match *://*/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
let intervalId = null;
// Create panel
const panel = [Link]('div');
[Link] = 'fixed';
[Link] = '10px';
[Link] = '10px';
[Link] = '#222';
[Link] = 'white';
[Link] = '5px';
[Link] = '9999';
[Link] = '4px';
[Link] = '9px';
[Link] = 'move';
[Link] = `
<strong style="cursor:move;">📤 POST Controller</strong><br>
<textarea id="postPayload" rows="4" cols="25" placeholder="Paste your Code
here"></textarea><br>
<button id="startPost">▶ Start</button>
<button id="stopPost">■ Stop</button>
<div id="postStatus" style="margin-top: 5px;"></div>
`;
[Link](panel);
const postUrl = "[Link]
[Link]("startPost").onclick = () => {
const payloadText = [Link]("postPayload").value;
if (!payloadText) return alert("Paste payload first!");
const formData = new URLSearchParams(payloadText);
intervalId = setInterval(() => {
fetch(postUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: formData
})
.then(response => [Link]())
.then(data => {
[Link]("Response:", data);
[Link]("postStatus").innerText = `Last sent: $
{new Date().toLocaleTimeString()}`;
})
.catch(err => {
[Link](err);
[Link]("postStatus").innerText = `Error: $
{err}`;
});
}, 1000);
};
[Link]("stopPost").onclick = () => {
clearInterval(intervalId);
[Link]("postStatus").innerText = "Stopped.";
};
// Make the panel draggable
let isDragging = false, offsetX, offsetY;
[Link]('mousedown', function (e) {
isDragging = true;
offsetX = [Link] - [Link]().left;
offsetY = [Link] - [Link]().top;
});
[Link]('mousemove', function (e) {
if (isDragging) {
[Link] = `${[Link] - offsetX}px`;
[Link] = `${[Link] - offsetY}px`;
[Link] = 'unset';
[Link] = 'unset';
}
});
[Link]('mouseup', function () {
isDragging = false;
});
})();