Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21f56c74b67c20a

Jump to content

Module:AfC topic

Permanently protected module
From Wikipedia, the free encyclopedia

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.main(frame)
	local args = getArgs(frame)
	return p._main(args)
end

function p._main(args)
	local ns = mw.title.getCurrentTitle().namespace
	if ns ~= 118 and ns ~= 2 then
		return '[[Category:AfC topic used in wrong namespace]]'
	end
	
	local data = mw.loadJsonData('Wikipedia:WikiProject Articles for creation/AfC topic map.json')
	
	local topic = args[1]
	local match = data[topic]
	
	if match ~= nil then
		return '[[Category:' .. match.category .. ']]'
	else 
		return '[[Category:AfC topic: invalid parameter]]'
	end
	
end

return p