您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
"TMA Script"
当前为
// ==UserScript== // @name Zeiterfassungscript // @version 4 // @grant GM.xmlHttpRequest // @include https://mytma.fe.hhi.de/* // @description "TMA Script" // @namespace https://greatest.deepsurf.us/users/149650 // ==/UserScript== window.setInterval(() => { let title = document.querySelector('#formularNameDiv').innerText; if (title.search('Startseite') > -1) { let netto; let total; let next = false; document.querySelectorAll('#ajaxZeitstatusDiv td').forEach((td, index, all) => { let match = td.innerHTML.match(/(\d+:\d+) Std\. \(Nettozeit ohne Pausen\)/i); if (match !== null) { netto = match[1]; } match = td.innerHTML.match(/heute/i); if (match !== null) { total = all[index + 1].innerHTML.match(/(\d+:\d+)/)[1]; console.log(td.innerHTML, all[index + 1].innerHTML); } }); GM.xmlHttpRequest({ method: "POST", url: "http://localhost:1234/post.php", data: JSON.stringify({netto, total}), headers: { "Content-Type": "application/x-www-form-urlencoded" } }); window.setTimeout(() => { let button = document.querySelector('#nANABWES'); if (button !== null) { button.click(); } else { document.querySelector('#themaAUSKUNFT').click(); window.setTimeout(() => { document.querySelector('#nANABWES').click(); }, 2000); } //window.location.reload(); }, 10000); } else if (title.search('Abwesenheit') > -1 ) { let colleagues = []; let next = false; document.querySelectorAll('.rundrumZelleMA').forEach((td, index, all) => { console.log(td); let match = td.innerHTML.match(/[a-z ]+, [a-z ]+/i); if (match !== null) { colleagues.push({ name: match[0].trim(), present: td.title.search('gekommen') > -1 }); } }); console.log(colleagues); GM.xmlHttpRequest({ method: "POST", url: "http://localhost:1234/post.php", data: JSON.stringify({colleagues}), headers: { "Content-Type": "application/x-www-form-urlencoded" } }); window.setTimeout(() => { document.querySelector('#nSTART').click(); //window.location.reload(); }, 10000); } }, 20000);