Module:NUMBEROF/meta
Appearance
From Wikipedia, the free encyclopedia
You might want to create a documentation page for this Scribunto module.
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
Editors can experiment in this module's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this module.
-- Return a table of statistics to be accessed once per page using mw.loadData. -- The table contains active and closed counts for each project. localfunctionmakeData() localstatistics=mw.ext.data.get('Wikipedia statistics/meta.tab')-- https://commons.wikimedia.org/wiki/Data:Wikipedia_statistics/meta.tab localmap={} fori,vinipairs(statistics.schema.fields)do map[v.name]=i-- name is lowercase end localiProject=map.project localiStatus=map.status localnrActive={} localnrClosed={} for_,vinipairs(statistics.data)do localproject=v[iProject] ifv[iStatus]=='active'then nrActive[project]=(nrActive[project]or0)+1 else nrClosed[project]=(nrClosed[project]or0)+1 end end return{ nrActive=nrActive, nrClosed=nrClosed, } end returnmakeData()