Last active
January 15, 2020 09:26
-
-
Save fitsum/2cfad7067f0f23ac3e243b7636a6a243 to your computer and use it in GitHub Desktop.
bible api stuffs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://api.scripture.api.bible/v1/bibles', {headers: {'api-key': 'ace65b88c21bc3d190f3f95754e2eede'}}) | |
.then((r) => r.json()) | |
.then((j) => { | |
const worldenglish = j.data.filter(item => item.name.indexOf('World English Bible') !== -1 ).map((item) => {return {"name":item.name, "description": item.description}}); | |
console.table(worldenglish); | |
}); | |
// Feeling fine about using `indexOf` | |
// https://stackoverflow.com/a/54538979 | |
//or IIFE with async/wait | |
(async () => { | |
let f = await fetch('https://api.scripture.api.bible/v1/bibles', {headers: {'api-key': 'ace65b88c21bc3d190f3f95754e2eede'}}); | |
let j = await f.json(); | |
const worldenglish = j.data.filter(item => item.name.indexOf('World English Bible') !== -1 ).map((item) => {return {"name":item.name, "description": item.description}}); | |
console.table(worldenglish); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment