-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Please add the "oldest" option to isArchived
to get the oldest archives in Wayback Machine.
From: https://news.ycombinator.com/item?id=30085477
The trick is to set the timestamp to be /really/ old and it will show the first snapshot it has.
ㅤ
Example:
// https://archive.org/wayback/available?url=http://github.com×tamp=19700101000000
const timestamp = new Date('January 1, 1970, UTC').toISOString().replace(/[-:T]/g, '').split('.')[0];
fetch(`https://archive.org/wayback/available?timestamp=${timestamp}&url=http://github.com`)
.then(response => response.json())
.then(data => {
console.log("Wayback Machine response:", data);
if (data.archived_snapshots && data.archived_snapshots.closest) {
console.log("Closest snapshot URL:", data.archived_snapshots.closest.url);
} else {
console.log("No snapshot available for that timestamp.");
}
})
.catch(error => {
console.error("Error fetching Wayback data:", error);
});
Result:
{
"url": "http://github.com",
"archived_snapshots": {
"closest": {
"status": "200",
"available": true,
"url": "http://web.archive.org/web/20080514210148/http://github.com/",
"timestamp": "20080514210148"
}
},
"timestamp": "19700101000000"
}
Metadata
Metadata
Assignees
Labels
No labels