// ==UserScript==
// @name Miped REPA rise test ver
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Andronio
// @match https://mipped.com/f/threads/skripty-na-javascript-dlja-aliehkspress*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
let elemMessages = document.querySelector('.block--messages');
if (!elemMessages) return alert("Не нашел сообщения");
let div = document.createElement('div');
div.className = 'block';
div.innerHTML = `<button id="button-repa-rise-test" class="button-repa-rise">Увеличить репу Andronio</button>`;
elemMessages.before(div);
let btn = document.getElementById('button-repa-rise-test');
if (!btn) return alert("Не нашел свою кнопку");
btn.style = "background-color: #ff1a1a; height: 100px; width: 400px";
btn.addEventListener('click', btnHandler);
function btnHandler() {
fetch("https://mipped.com/engine/ajax/repa.php", {
"headers": {
"accept": "*/*",
"accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://mipped.com/user/Andronio/",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "action=plus&user_id=58948&dorepa=2&post_id=1&act=0&skin=miped2&description=exp",
"method": "POST",
"mode": "cors",
"credentials": "include"
})
.then(resp => resp.text())
.then(text => {
console.log(text);
})
}
})();