22 lines
673 B
JavaScript
22 lines
673 B
JavaScript
const { getArchiveUrl, saveToArchive } = require("./lib/archive");
|
|
|
|
(async () => {
|
|
const testUrl = "https://richard.dern.ovh";
|
|
|
|
console.log(`🔍 Checking Archive.org for: ${testUrl}`);
|
|
let archiveUrl = await getArchiveUrl(testUrl);
|
|
|
|
if (archiveUrl) {
|
|
console.log(`✔ Archive found: ${archiveUrl}`);
|
|
} else {
|
|
console.log(`❌ No archive found, requesting a new one...`);
|
|
archiveUrl = await saveToArchive(testUrl);
|
|
|
|
if (archiveUrl) {
|
|
console.log(`✔ URL successfully archived: ${archiveUrl}`);
|
|
} else {
|
|
console.log(`❌ Failed to archive the URL.`);
|
|
}
|
|
}
|
|
})();
|