Modul:Stadtwikis: Unterschied zwischen den Versionen

Aus FürthWiki

keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 4: Zeile 4:
--local http = require("mw.http")
--local http = require("mw.http")
--local json = require("mw.text").jsonDecode
--local json = require("mw.text").jsonDecode
function p.Versuch(frame)
function p.Trennenen(frame)
local urls = {"https://www.fuerthwiki.de/wiki/api.php",  
local urls = {"https://www.fuerthwiki.de/wiki/api.php",  
    "https://oesterreichwiki.org/w/api.php",
    "https://oesterreichwiki.org/w/api.php",
Zeile 25: Zeile 25:
-- "https://wuerzburgwiki.de/w/api.php",
-- "https://wuerzburgwiki.de/w/api.php",
----------------------------------------------------------------------------
----------------------------------------------------------------------------
return
end
function Versuch(frame)
ep_stat = "?action=query&meta=siteinfo&siprop=statistics&format=json"
ep_stat = "?action=query&meta=siteinfo&siprop=statistics&format=json"
ep_info = "?action=query&meta=siteinfo&format=json"
ep_info = "?action=query&meta=siteinfo&format=json"
      
      
     --local urls = {
     local urls = {
    --    "https://www.fuerthwiki.de/wiki/api.php",
        "https://www.fuerthwiki.de/wiki/api.php",
    --    "https://www.tuepedia.de/api.php"
        "https://www.tuepedia.de/api.php"
     --}
     }
     local results = {}
     local results = {}
     for i = 1, #urls do
     for i = 1, #urls do
Zeile 42: Zeile 46:
         }
         }
     end
     end
   
h='<table class="wikitable sortable"><tr>'..
    local output = {}
'<th>Wiki URL</th>'..
    for i, pair in ipairs(results) do
'<th>Artikel</th>'..
        --local a = pair.A and pair.A.query and pair.A.query.statistics and pair.A.query.statistics.edits or "?"
'<th>Bilder</th>'..
        --local b = pair.B and pair.B.query and pair.B.query.statistics and pair.B.query.statistics.edits or "?"
'<th>Bearbeitungen</th>'..
        --table.insert(output, string.format("Zeile %d: A = %s, B = %s", i, a, b))
'<th>Benutzer</th>'..
    mw.log("Stats: " .. mw.dumpObject(pair))
'<th>Aktive</th>'..
    end
'<th>Admins</th>'..
 
'</tr>'
    return tableToString(results) --table.concat(output, "<br>")
return tableToString(results)
end
end