0% found this document useful (0 votes)
15 views2 pages

Auto POST Request Controller Script

This document is a UserScript that automates sending POST requests every second to a specified URL with a draggable control panel. It allows users to input a payload and start or stop the requests, displaying the status of the last sent request. The script includes functionality for making the control panel draggable on the webpage.

Uploaded by

pahlob.rs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Auto POST Request Controller Script

This document is a UserScript that automates sending POST requests every second to a specified URL with a draggable control panel. It allows users to input a payload and start or stop the requests, displaying the status of the last sent request. The script includes functionality for making the control panel draggable on the webpage.

Uploaded by

pahlob.rs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

// ==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;
});
})();

You might also like