⚠️ UNMAINTAINED, PLEASE USE WIKIDATA
npm install world-heritage-image
const heritageImage = require('world-heritage-image')
heritage(heritageID).then(…)
Returns a Promise that will resolve in a wikimedia commons photo file name:
heritage(3).then(console.log) // => 'Aachener Dom.jpg'
heritage(402384).then(console.log) // => null
You can combine this module with [world-heritage](https://github.com/juliuste/world-heritage)
and `commons-photo-url:
const heritage = require('world-heritage')
const image = require('world-heritage-image')
const commons = require('commons-photo-url')
heritage()
.then((list) => list.map(x => x.id)) // UNESCO heritage ids
.then((ids) => Promise.all(
ids.map(image)
))
.then((fileNames) => fileNames.filter((f) => !!f)) // remove heritage sites that lack a wikimedia commons image
.then((fileNames) => fileNames.map((f) => commons(f, commons.sizes.medium)))
.then(console.log)
// => [url1, url2, …]
- world-heritage - UNESCO world heritage sites
- commons-photo-url - Generate the Wikimedia Commons URL of a photo
- world-heritage-twitter-bot - UNESCO world heritage twitter bot
If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit the issues page.