Created
April 15, 2025 14:26
-
-
Save QuiltMeow/26273c685730301da3ec78655410a0aa to your computer and use it in GitHub Desktop.
Host Loc Gain Point
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
| // https://hostloc.com/ | |
| function getRandomValue(min, max) { | |
| return Math.floor(Math.random() * (max - min + 1) + min); | |
| } | |
| function getUniqueRandomList(size) { | |
| let ret = new Set(); | |
| while (ret.size < size) { | |
| ret.add(getRandomValue(1, 77000)); | |
| } | |
| return [...ret]; | |
| } | |
| function fetchURL(count) { | |
| let period = 6000; | |
| let visitId = getUniqueRandomList(count); | |
| for (let i = 0; i < count; ++i) { | |
| let id = visitId[i]; | |
| setTimeout(() => { | |
| fetch(`https://hostloc.com/space-uid-${id}.html`).then(response => { | |
| if (response.ok) { | |
| console.log("完成存取 ID:" + id); | |
| } else { | |
| console.error("存取 ID:" + id + " 時失敗:" + response.status); | |
| } | |
| }).catch(error => { | |
| console.error("存取 ID:" + id + " 時發生例外狀況:" + error); | |
| }); | |
| }, i * period); | |
| } | |
| } | |
| fetchURL(20); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment