Created
January 29, 2017 02:09
-
-
Save denniskupec/5da146250ef896a7cfbe4b20ad2cdb09 to your computer and use it in GitHub Desktop.
bookmarklet extracts the subnets from ipinfo.io pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
javascript:(()=>{let n,q,f;n=(i)=>{return parseInt(i.replace(',',''));};q=(s,d=document)=>{return d.querySelectorAll(s);};f=(v,k,l)=>{let r=q('td',v);if(r.length>2){document.write(`${r[0].innerText}, ${n(r[2].innerText)}<br>`);}};q('#block-table tr').forEach(f);})(); | |
*/ | |
let n, q, f; | |
n = (i)=>{return parseInt(i.replace(',',''));}; | |
q = (s,d=document)=>{return d.querySelectorAll(s);}; | |
f = (v,k,l) => { | |
let r = q('td', v); | |
if (r.length > 2) { | |
document.write(`${r[0].innerText}, ${n(r[2].innerText)}<br>`); | |
} | |
}; | |
q('#block-table tr').forEach(f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment