Widget: Homepage: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 109: | Line 109: | ||
var platformResponse = await fetch(platformQuery).then(response => response.json()); | var platformResponse = await fetch(platformQuery).then(response => response.json()); | ||
console.log(platformResponse) | console.log(platformResponse) | ||
var platformData = Object.getOwnPropertyNames(platformResponse.query.results).map( | var platformData = Object.getOwnPropertyNames(platformResponse.query.results).map(pName => { | ||
return { name: | return { name: pName, image: platformResponse.query.results[pName].printouts.IMAGE[0].fulltext.replace('PAGENAME:', '') }; | ||
}); | }); | ||
var imageUrlQuery = '/api.php?action=query&format=json&prop=imageinfo&iiprop=url&titles=' + | |||
encodeURIComponent(platformData.map(platform => platform.image).join('|')); | |||
console.log(imageUrlQuery) | |||
var res = await fetch(imageUrlQuery).then(response => response.json()); | |||
console.log( | |||
var res = await fetch( | |||
console.log(res) | console.log(res) | ||
} | } |
Revision as of 12:37, 2 June 2022
Development verstion of the DCT Homepage.
Not ready for production!