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: a2291e958fd11330

Jump to content

Module:NYC bus link

Permanently protected module
From Wikipedia, the free encyclopedia

require("strict");
local getArgs = require('Module:Arguments').getArgs
local p = {}

function p.getLink(frame)
	local args = getArgs(frame);
	local result = {};
	local city;
	
	args.city = args.city:lower();
	
	if 'nyc' == args.city then
		city = 'New York City bus';
	elseif 'li' == args.city then
		city = 'Long Island bus';
	elseif 'nj' == args.city then
		city = 'New Jersey bus';
	elseif 'columbia' == args.city then
		city = 'Columbia Transportation'
	elseif 'princeton' == args.city then
		city = 'Tiger Transit'
	else
		return table.concat ({'<span style=\"font-size:100%; font-style:normal;\" class=\"error\">unexpected city: ', args.city, '</span>'})
	end
		
	for _, name in ipairs (args) do
		table.insert (result, table.concat ({'[[', name, ' (', city, ')|', name, ']]'}))
	end
	
	if ('yes' == args.prose) or ('y' == args.prose) then
		return mw.text.listToText (result);
	else
		return table.concat (result, ', ');
	end
end

return p;