Created
November 6, 2020 19:51
-
-
Save Delivator/c99703566a48553184e184f267df1700 to your computer and use it in GitHub Desktop.
Smart skylink
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
fetch("https://siastats.info/dbs/skynet_current.json") | |
.then((r) => r.json()) | |
.then((portals) => { | |
portals.forEach((portal) => { | |
const link = `${portal.link}/${skylink}`; | |
fetch(link, { method: "HEAD" }).then((resp) => { | |
if (resp.ok) location = link; | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment