Created
March 7, 2019 06:48
-
-
Save b1tninja/a2013fe74c063d469e67faac973c5eb1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fetch('https://www.archlinux.org/master-keys/').then(resp=>{ | |
resp.text().then(html=>{ | |
parser = new DOMParser(); | |
doc = parser.parseFromString(html, "text/html"); | |
xpath_result = doc.evaluate('//tr[th/text()]//a[contains(@href, "https://sks-keyservers.net/pks/lookup?op=vindex&fingerprint=on&exact=on&search=")]', doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE) | |
for (i = 0; i < xpath_result.snapshotLength; i++) { | |
a = xpath_result.snapshotItem(i); | |
fingerprint = (new URL(a.href,window.location)).searchParams.get('search'); | |
developer = doc.evaluate('ancestor::tr/th/text()', a, null, XPathResult.STRING_TYPE).stringValue; | |
console.log(`${fingerprint} ${developer}`); | |
} | |
} | |
) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment