Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jarofghosts/memento-client
client for wayback machine data
https://github.com/jarofghosts/memento-client
Last synced: about 2 months ago
JSON representation
client for wayback machine data
- Host: GitHub
- URL: https://github.com/jarofghosts/memento-client
- Owner: jarofghosts
- License: mit
- Created: 2014-06-19T04:01:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-07-31T18:37:14.000Z (over 7 years ago)
- Last Synced: 2024-10-19T23:21:02.363Z (2 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 14
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-memento - src - client)) - JavaScript client to interface with Memento services (Software / Command-line Clients)
README
# memento-client
[![Build Status](http://img.shields.io/travis/jarofghosts/memento-client.svg?style=flat-square)](https://travis-ci.org/jarofghosts/memento-client)
[![npm install](http://img.shields.io/npm/dm/memento-client.svg?style=flat-square)](https://www.npmjs.org/package/memento-client)
[![npm version](https://img.shields.io/npm/v/memento-client.svg?style=flat-square)](https://www.npmjs.org/package/memento-client)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
[![License](https://img.shields.io/npm/l/memento-client.svg?style=flat-square)](https://github.com/jarofghosts/memento-client/blob/master/LICENSE)simple interface to memento services
## usage
```js
var memento = require('memento-client')memento(url, listAll)
function listAll (err, mementos) {
console.log(mementos) // [{href: url, rel: identifier, datetime: timestamp}]
}// provide an options object with time to narrow your search!
memento(url, {time: '2010'}, list2010)function list2010 (err, mementos) {
console.log(mementos) // all found from 2010
}// also optionally provide your own host's timemap! (defaults to the wayback machine)
memento(url, {host: 'http://some-other-memento-provider/timemap'}, getCustom)
function getCustom (err, mementos) {
// ta-da!
}
```## notes
* `identifier` is one of: `first memento`, `prev memento`, `next memento`,
`memento`, or `last memento`.
* finds nearest available memento for `url` to `opts.time`
* `opts.time` can be any reasonable approximation of a datetime and it should
Just Work(tm)
* filters out non-mementos from response (timegate and original url)
* first and last entries in response will always be the first and last
mementos available.## license
MIT