Content deleted Content added
implement DEPTH parameter for Wikipedias that use it |
fix depth: need map |
||
Line 16:
-- https://meta.wikimedia.org/wiki/Wikipedia_article_depth
-- This gives silly results if, for example, the number of articles is small.
if map then
for i, v in ipairs(n) do
n[i] = map[v]
end
end
for i, v in ipairs(n) do
n[i] = stats[v] or 0
end
local articles, edits, pages = n[1], n[2], n[3]
if pages == 0 or articles == 0 then
return 0
end
return math.floor((
end
if map then
|