#Host Image Resolver
Talks to various image hosting services to resolve a URL into all pictures associated with said URL.
- imgur (auth required for albums)
- deviantArt (including fav.me URLs)
- gfycat
- tumblr (auth required)
- yande.re
npm install host-image-resolver
Some services require authentication tokens. To set these values, you can create a hir-config.js file in the root of your project.
module.exports = {
IMGUR_CLIENT_SECRET: 'the-secret',
TUMBLER_KEY: 'tumbl-tumbl'
};HIR is simple to use, exposing only one public method:
const hostImageResolver = require('host-image-resolver');
hostImageResolver('http://imgur.com/a/an-album').then((urls) => {
console.log(urls);
// [ 'https://i.imgur.com/image1.jpg', 'https://i.imgur.com/image2.jpg' ]
// urls will always be an array
});