Widget: DCTList: Difference between revisions
From LINKS Community Center
Eschmidt (talk | contribs) No edit summary |
Eschmidt (talk | contribs) No edit summary |
||
Line 145: | Line 145: | ||
// Fetches platform / data source information. | // Fetches platform / data source information. | ||
async function getSources() { | async function getSources() { | ||
const IMG_KEY = 'IMAGE'; | |||
const sourceResponse = await fetch( | const sourceResponse = await fetch( | ||
getQueryUrl('[[Category:Social media platform]]|? | getQueryUrl('[[Category:Social media platform]]|?' + IMG_KEY) | ||
).then(response => response.json()); | ).then(response => response.json()); | ||
const results = sourceResponse.query.results; | const results = sourceResponse.query.results; | ||
return Object.keys(results).map(platform => { | return Object.keys(results).map(platform => { | ||
const img = results[platform].printouts[ | const img = results[platform].printouts[IMG_KEY][0]; | ||
console.log(img) | |||
return { | return { | ||
name: platform, | name: platform, |
Revision as of 08:36, 31 August 2022
Development verstion of the DCT List.
Not ready for production!