Advertisement
John4711

mtr all nodes

Jun 5th, 2022
1,004
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // mtr query all nodes
  2. fetch("/p/mtr1.php?q=probes").then(r=>r.json()).then(d=>{
  3.    // console.log(Object.values(d).filter(v=>v.caps.mtr&v.status4));
  4.    var mtr=Object.entries(d).filter(v=>v[1].caps.mtr&&v[1].status4).map(v=>v[0]);
  5.    document.body.innerHTML="";var pre=document.body.appendChild(document.createElement("pre"));
  6.    var ip='9.9.9.9';
  7.    function aaa(){var x=mtr.shift();if(!x)return false;fetch(`/p/mtr1.php`,{body:`k=${x}&q=${ip}`, method:"POST", headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}).then(r=>r.status==200?r.text():x).then(d=>{aaa();pre.insertAdjacentText('afterbegin',d)})}
  8.    for (var i=0;i<25;i++)aaa();
  9. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement