Widget: Homepage: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 105: Line 105:


     <script>
     <script>
         async function data() {
         async function getData() {
             var query = '[[Category:Social media platform]]|?IMAGE';
             var platformQuery = '/api.php?action=ask&format=json&query=' + encodeURIComponent('[[Category:Social media platform]]|?IMAGE');
             var data  = await fetch('/api.php?action=ask&format=json&query=' + encodeURIComponent(query)).then(response => response.json());
             var platformResponse = await fetch(platformQuery).then(response => response.json());
             console.log(data)
            var platformData = Object.getOwnPropertyNames(platformResponse.results).map(name => {
                return { name: name, image: platformResponse.results[name].printouts.IMAGE[0].fulltext }
            });
             console.log(platformData);
         }
         }


         data();
         getData();
     </script>
     </script>



Revision as of 12:16, 2 June 2022

Development verstion of the DCT Homepage.
Not ready for production!