Modulis:Ārējās saites/Datorspēle
Moduļa dokumentācija[izveidot]
Iespējams, vēlies izveidot dokumentāciju šim modulim Vari eksperimentēt šī moduļa smilšu kastes (izveidot | spoguļversija) un testu (izveidot) lapā Lūdzu, kategorijas pievieno dokumentācijas apakšlapā. Moduļa apakšlapas. |
local messages = {
["invalid"] = "[[Kategorija:Raksti ar nederīgiem ārējo saišu identifikatoriem]]",
["localpar"] = "[[Kategorija:Raksti ar lokālajiem ārējo saišu veidnes parametriem]]",
["empty"] = "[[Kategorija:Raksti ar tukšu ārējo saišu veidni]]"
}
function imdbLink( id )
if not string.match( id, '^t?t?%d*$' ) then
return false
end
if string.find( id, 'tt', 1, true ) then
id = string.gsub( id, 'tt', '' )
end
return 'http://www.imdb.com/title/tt' .. id .. '/'
end
function steamLink( id )
if not string.match( id, '^%d*$' ) then
return false
end
return 'https://steamdb.info/app/' .. id .. '/info/'
end
function gogLink( id )
if not string.match( id, '^%d*$' ) then
return false
end
return 'https://www.gog.com/' .. id
end
function allgameLink( id )
if not string.match( id, '^%d*$' ) then
return false
end
return 'https://web.archive.org/web/*/http://allgame.com/game.php?id=' .. id
end
function mobygamesLink( id )
if not string.match( id, '^%d*$' ) then
return false
end
return 'https://www.mobygames.com/game/' .. id
end
function metacriticLink( id )
return 'http://www.metacritic.com/' .. id
end
local configuration = {
{ 'imdb', "''Internet Movie Database'' profils", 345, imdbLink, 'en' },
{ 'steam', "''Steam'' profils", 1733, steamLink, 'en' },
{ 'gog', "GOG profils", 2725, gogLink, 'en' },
{ 'allgame', "''Allgame'' profils", 907, allgameLink, 'en' },
{ 'mobygames', "''MobyGames'' profils", 1933, mobygamesLink, 'en' },
{ 'metacritic', "''Metacritic'' profils", 1712, metacriticLink, 'en' },
}
local p = {}
function p.getConfiguredClaims (self)
return configuration
end
function p.getMessages (self)
return messages
end
return p