Package Exports
- wayback-machine
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wayback-machine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
wayback-machine
Internet Wayback Machine Client
API
getTimeline
Get the timeline with all the snapshots (mementos) of a given URL taken by http://web.archive.org
var wayback = require('wayback-machine');
wayback.getTimeline(url, function(err, timeline) {
if (err) {
console.error(err);
return;
}
console.log('Timeline for <%s>:', url);
console.log(timeline);
});
Timeline example:
{ original: 'http://macbre.net',
timegate: 'http://web.archive.org/web/http://macbre.net',
first:
{ url: 'http://web.archive.org/web/20080529061028/http://macbre.net/',
time: Thu May 29 2008 08:10:28 GMT+0200 (CEST) },
last:
{ url: 'http://web.archive.org/web/20150801212811/http://macbre.net/',
time: Sat Aug 01 2015 23:28:11 GMT+0200 (CEST) },
mementos:
[ { url: 'http://web.archive.org/web/20080529061028/http://macbre.net/',
time: Thu May 29 2008 08:10:28 GMT+0200 (CEST) },
{ url: 'http://web.archive.org/web/20080701120010/http://macbre.net/',
time: Tue Jul 01 2008 14:00:10 GMT+0200 (CEST) },
{ url: 'http://web.archive.org/web/20080702181112/http://macbre.net/',
time: Wed Jul 02 2008 20:11:12 GMT+0200 (CEST) },
...
{ url: 'http://web.archive.org/web/20150801212811/http://macbre.net/',
time: Sat Aug 01 2015 23:28:11 GMT+0200 (CEST) } ] }
getClosest
Get the latest URL snapshot using Wayback Availability JSON API
var wayback = require('wayback-machine');
wayback.getClosest(url, function(err, closest) {
if (err) {
console.error(err);
return;
}
console.log('The closest snapshot for <%s>:', url);
console.log(closest);
});
Closest example:
{ available: true,
url: 'http://web.archive.org/web/20111008092403/http://macbre.net:80/',
timestamp: '20111008092403',
status: '200' }