Skip to content

Instantly share code, notes, and snippets.

@JanThiel
Created September 19, 2020 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JanThiel/04996a40e2baf2a5d6e5e5e14b042166 to your computer and use it in GitHub Desktop.
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
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