0xab178613…feaasent to0xd6878475…ab48·#21,063,919·view on Etherscan
function digitalPetitPrince() {
const domains = [
"rose",
"fox",
"planet",
"star",
"friend",
"baobab",
"sheep",
"laugh",
"sunset",
"well",
"asteroid",
"journey",
];
const tlds = [".com", ".org", ".net", ".io", ".space"];
const emojis = ["🌍", "🪐", "👋", "🤝", "🌟", "💔", "🚀"];
const quotes = [
"What is essential is invisible to the eye.",
"You become responsible, forever, for what you have tamed.",
"All grown-ups were once children... but only few of them remember it.",
"It is only with the heart that one can see rightly.",
"Where are the people? It's a little lonely in the desert...",
];
const random = (arr) => arr[Math.floor(Math.random() * arr.length)];
async function visitPlanet() {
const domain =
random(domains) +
(Math.random() < 0.3 ? "-" + random(domains) : "") +
random(tlds);
console.log("\\n" + random(emojis) + " The Little Prince visits " + domain);
try {
const response = await fetch("https://" + domain, {
method: "GET",
mode: "no-cors",
});
console.log(
response.ok
? '👋 "Hello," said the Little Prince to ' + domain + "."
: "😢 The planet " + domain + " was silent."
);
} catch {
console.log("❌ The Prince encountered a mystery.");
}
if (Math.random() < 0.4) console.log('\\n🌹 "' + random(quotes) + '"');
console.log("---");
}
(async function exploreUniverse() {
while (true) {
await visitPlanet();
await new Promise((resolve) =>
setTimeout(resolve, Math.random() * 3000 + 1000)
);
}
})();
}
digitalPetitPrince();