Open main menu
local str = {}
 
function str.isCorrect(frame)
	id = frame.args[1]
    _, _, a, b, c = mw.ustring.find(id, "^(%d%d)-(%d%d%d)-(%d%d%d%d)$")

	if (a==nil) or (b==nil) or (c==nil) then
		return "<div style='color:red'>wrong Id:" .. id .. "</div> [[Category:Natural heritage sites in Ukraine with wrong IDs]]"
	else
		return "[http://tools.wmflabs.org/wle/?id="..id.." "..id.."]"
	end
end

function str.isCorrectWLM(frame)
	id = frame.args[1]
    _, _, a, b, c = mw.ustring.find(id, "^(%d%d)-(%d%d%d)-(%d%d%d%d)$")

	if (a==nil) or (b==nil) or (c==nil) then
		return "<div style='color:red'>wrong Id:" .. id .. "</div> [[Category:Cultural heritage monuments in Ukraine with incorrect IDs]]"
	else
		return "[http://tools.wmflabs.org/heritage/api/api.php?action=search&format=html&srcountry=ua&srlang=uk&srid="..id.."&props=image%7Cname%7Caddress%7Cmunicipality%7Clat%7Clon%7Cid%7Ccountry%7Csource%7Cmonument_article%7Cregistrant_url "..id.."]" 	end
end

return str