Skip to content

Instantly share code, notes, and snippets.

@JamesDonnelly
Created April 7, 2017 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesDonnelly/eded2d8a5fda5247ec6461485f9149cc to your computer and use it in GitHub Desktop.
Save JamesDonnelly/eded2d8a5fda5247ec6461485f9149cc to your computer and use it in GitHub Desktop.
const config = {
method: 'GET',
mode: 'cors'
}
fetch(
"http://api.xivdb.com/minion?columns=behavior,icon,id,name_en,minion_race",
config
)
.then(response => response.json())
.then(response => {
process(response);
})
.catch(e => console.error(e));
function process(response) {
let result = {};
response.forEach(a => {
result[a.id] = {
behavior: a.behavior,
icon: a.icon,
name: a.name_en,
race: a.minion_race
}
})
console.info(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment