Created
September 19, 2020 11:33
-
-
Save JanThiel/04996a40e2baf2a5d6e5e5e14b042166 to your computer and use it in GitHub Desktop.
Get all the Authcodes from the current list of Domains in the Hetzner Robot. https://robot.your-server.de/domain
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
async function getAuthCode(id = '') { | |
const resp = await fetch("https://robot.your-server.de/domain/authcode/id/"+id, { | |
"headers": { | |
"accept": "*/*", | |
"accept-language": "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7", | |
"cache-control": "no-cache", | |
"pragma": "no-cache", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", | |
"sec-fetch-site": "same-origin", | |
"x-requested-with": "XMLHttpRequest" | |
}, | |
"referrer": "https://robot.your-server.de/domain/index/page/1", | |
"referrerPolicy": "no-referrer-when-downgrade", | |
"body": null, | |
"method": "GET", | |
"mode": "cors", | |
"credentials": "include" | |
}); | |
return resp.text(); | |
} | |
document.querySelectorAll(".box_wide").forEach( | |
(el) => { | |
let domain = el.querySelector(".box_title .title").innerHTML; | |
let id = el.querySelector(".box_content").id.substr(8); | |
getAuthCode(id).then(authCode => { | |
console.debug(domain + " :: ", authCode) | |
}) | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment