John4711

hallo dbip callback

Jul 1st, 2022 (edited)
208
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.86 KB | None
  1. var list1=Array.from(new Set(document.body.innerHTML.match(/\d+\.\d+\.\d+\.\d+/gim))); var q=0,u=new Map();
  2. list1=list1.filter(v=>!/^(10|127|224|255|192\.168|172\.(1[6-9]|2[0-9]|3[0-1])\.)/.test(v));
  3.  
  4. function hallo(o){
  5.    q--;
  6.    for (var x of o.response) {u.set(x.a,x.c.toLowerCase())};
  7.    
  8.    if (q==0 && u.size>0) {
  9.        console.log("done",u.size)
  10.        var acc={}; for (var x of u.values())  acc[x] ? ++acc[x] : acc[x] = 1;
  11.        console.log(acc);
  12.        var top=Object.entries(acc).sort((a,b)=>b[1]-a[1]).map(v=>{var o={}; o[v[0]]=v[1];return o });
  13.        console.log(top)
  14.    }
  15.                  }
  16.  
  17. for (var x,n,i=0;i<list1.length;x=list1.slice(i,i+50),i+=50) {
  18. q++;
  19. var s=document.head.appendChild(document.createElement("script"));s.async=true; s.src="https://db-ip.com/tools/getcountry_multi.php?callback=hallo&" + x.map(v=>`a[]=${v}`).join("&");  
  20. }
RAW Paste Data Copied