Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jimkang/random-internet-archive
Gets a random Internet Archive resource, in URL form with some metadata.
https://github.com/jimkang/random-internet-archive
Last synced: 7 days ago
JSON representation
Gets a random Internet Archive resource, in URL form with some metadata.
- Host: GitHub
- URL: https://github.com/jimkang/random-internet-archive
- Owner: jimkang
- Created: 2018-09-27T00:22:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T01:36:50.000Z (almost 2 years ago)
- Last Synced: 2024-04-09T21:11:50.567Z (7 months ago)
- Language: JavaScript
- Size: 49.8 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
random-internet-archive
==================Gets a random Internet Archive resource, in URL form with some metadata.
Installation
------------npm install random-internet-archive
Usage
-----var randomInternetArchive = require('random-internet-archive');
var request = require('request');randomInternetArchive(
{
request,
collection: 'mathematicsimage',
mediatype: 'image',
fileExtensions: ['jpg', 'jpeg'],
minimumSize: 20000,
maximumSize: 2000000
},
);
function print(error, result) {
if (error) {
console.error(error);
} else {
console.log(result);
}
}Output:
{
"url": "https://ia902503.us.archive.org/16/items/mathematics_05445812/mathematics_05445812_2.jpg",
"collection": "mathematicsimage",
"title": "Mathematics-Image-36",
"size": "337791",
"format": "JPEG"
}The `request` opt can either be the [request](https://github.com/request/request) module or [one that conforms to that interface](https://github.com/jimkang/spotify-resolve#plug-in-your-own-request-library). For example, I use [basic-browser-request](https://github.com/jimkang/basic-browser-request/) when using this in the browser.
Tests
-----Run tests with `make test`.
License
-------The MIT License (MIT)
Copyright (c) 2018 Jim Kang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.