Module:Library Listing: Difference between revisions

From Comprehensible Input Wiki
Content added Content deleted
No edit summary
No edit summary
Tag: Reverted
Line 4: Line 4:


local g = mw.ext.externaldata.getWebData {
local g = mw.ext.externaldata.getWebData {
url = 'https://comprehensibleinputwiki.com/api.php?count=true',
url = 'https://ciw.fluwenti.com/api.php?count=true',
data = {language, count},
data = {language, count},
format = 'JSON'
format = 'JSON'

Revision as of 22:05, 16 March 2023

Documentation for this module may be created at Module:Library Listing/doc

local p = {}

function createTable()

    local g = mw.ext.externaldata.getWebData {
        url = 'https://ciw.fluwenti.com/api.php?count=true',
        data = {language, count},
        format = 'JSON'
    }

    tableOut = '<table id="library-listing" class="wikitable" style="margin-left:auto;margin-right:auto"><tr id="lib-header"><th>Language</th><th>Video Count</th></tr>'

    for key, value in ipairs(g) do
        tableOut = tableOut .. '<tr><td>[[' .. value['language'] .. '/Library|' .. value['language'] .. ']]</td><td>' .. value['count'] .. '</td></tr>'
    end

    tableOut = tableOut .. '</table>'

    return tableOut

end



p.showList = function()
	return createTable()
end


return p