Pāriet uz saturu

Modulis:Sporta ārējās saites

Permanently protected module
Vikipēdijas lapa
Dokumentācijas ikona Moduļa dokumentācija[skatīt] [labot] [hronoloģija] [pārlādēt]

Šajā modulī tiek implementēta {{Sporta ārējās saites}} veidne. Plašāku dokumentāciju skatīt veidnes apraksta lapā.

local categories = {
	["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 sporta ārējo saišu veidni]]"
}

function srLink( id )
    return 'http://www.sports-reference.com/olympics/athletes/' .. id .. '.html'
end

function olympediaLink( id )
    return 'https://www.olympedia.org/athletes/' .. id
end

function espnLink( id )
    return 'http://sports.espn.go.com/' .. id
end

function sportorgLink( id )
    return 'https://www.the-sports.org/t-spf' .. id .. '.html'
end

function munsportLink( id )
    return 'https://www.munzinger.de/search/go/document.jsp?id=' .. id
end

function atpLink( id )
    return 'http://www.atpworldtour.com/en/players/wikidata/' .. id .. '/overview'
end

function wtaLink( id )
    return 'https://www.wtatennis.com/players/' .. id .. '/name'
end

function itfLink( id )
    return 'https://www.itftennis.com/en/players/' .. id
end

function atptourLink( id )
    return 'https://www.atptour.com/en/tournaments/-/' .. id .. '/overview'
end

function wtatourLink( id )
    return 'https://www.wtatennis.com/tournament/' .. id .. '/-'
end

function davisLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'https://www.daviscup.com/en/players/player.aspx?id=' .. id
end

function fedLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'https://www.billiejeankingcup.com/en/players/player.aspx?id=' .. id
end

function tennishofLink( id )
    return 'https://www.tennisfame.com/hall-of-famers/inductees/' .. id
end

function tennistempLink( id )
    return 'https://en.tennistemple.com/-ps' .. id
end

function tennisabstractLink( id )
    return 'http://www.tennisabstract.com/cgi-bin/player.cgi?p=' .. id
end

function cycaLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.cyclingarchives.com/coureurfiche.php?coureurid=' .. id
end

function cycqLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.cqranking.com/men/asp/gen/rider.asp?riderid=' .. id
end

function cycqwLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.cqranking.com/women/asp/gen/rider.asp?riderid=' .. id
end

function cycdLink( id )
    return 'https://www.cyclebase.nl/cb-content/index.php?lang=en&page=renner&id=' .. id
end

function bmxLink( id )
    return 'https://www.bmx-results.com/db/riders_info.php?id=' .. id
end

function procLink( id )
    --[=[if not string.match( id, '^[1-9][0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?$' ) then
        return false
    end]=]
    return 'http://www.procyclingstats.com/rider/' .. id
end

function procteamLink( id )
    return 'https://www.procyclingstats.com/team/' .. id
end

function fifaLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.fifa.com/worldfootball/statisticsandrecords/players/player=' .. id
end

function uefaLink( id )
    if not string.match( id, '^[1-9][0-9][0-9][0-9][0-9][0-9]?[0-9]?[0-9]?[0-9]?$' ) then
        return false
    end
    return 'http://www.uefa.com/teamsandplayers/players/player=' .. id
end

function worldfLink( id )
    return 'http://www.worldfootball.net/player_summary/' .. id
end

function socbpLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.soccerbase.com/players/player.sd?player_id=' .. id
end

function socbmLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.soccerbase.com/managers/manager.sd?manager_id=' .. id
end

function socbteamLink( id )
return 'https://www.soccerbase.com/teams/team.sd?team_id=' .. id
end

function soccerwayLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'https://int.soccerway.com/players/-/' .. id .. '/'
end

function nftLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.national-football-teams.com/player/' .. id .. '.html'
end

function transfpLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.transfermarkt.com/transfermarkt/profil/spieler/' .. id
end

function transmpLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.transfermarkt.com/transfermarkt/profil/trainer/' .. id
end

function transteamLink( id )
    return 'https://www.transfermarkt.com/-/startseite/verein/' .. id .. '/'
end

function mlsLink( id )
    if not string.match( id, '^[-a-z]+[0-9]*$' ) then
        return false
    end
    return 'http://www.mlssoccer.com/players/' .. id
end

function eurofootLink( id )
    return 'https://eu-football.info/_player.php?id=' .. id
end

function stadiumLink( id )
    return 'http://stadiumdb.com/stadiums/' .. id
end

function fbrefLink( id )
    return 'https://fbref.com/en/players/' .. id
end

function fideLink( id )
    return 'https://ratings.fide.com/card.phtml?event=' .. id
end

function chessLink( id )
    return 'http://www.chessgames.com/perl/chessplayer?pid=' .. id
end

function chess365Link( id )
    return 'http://www.365chess.com/players/' .. id
end

function brmajLink( id )
    return 'http://www.baseball-reference.com/players/' .. id .. '.shtml'
end

function brminLink( id )
    return 'http://www.baseball-reference.com/minors/player.cgi?id=' .. id
end

function sabrLink( id )
    return 'http://sabr.org/bioproj/person/' .. id
end

function eliteLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.eliteprospects.com/player.php?player=' .. id
end

function hockeydbLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.hockeydb.com/ihdb/stats/pdisplay.php?pid=' .. id
end

function eurohLink( id )
    return 'http://www.eurohockey.com/player/' .. id .. '-.html'
end

function nhlLink( id )
    return 'http://www.nhl.com/ice/player.htm?id=' .. id .. '/'
end

function hockeyrefLink( id )
    return 'https://www.hockey-reference.com/players/' .. id .. '.html'
end

function khlLink( id )
    return 'https://en.khl.ru/players/' .. id .. '/'
end

function lokLink( id )
    return 'http://olimpiade.lv/lv/latvijas-olimpiesi/' .. id
end

function iaafLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'https://www.worldathletics.org/athletes/_/' .. id
end

function trachfieldfLink( id )
    return 'http://trackfield.brinkster.net/Profile.asp?ID=' .. id .. '&Gender=W'
end

function trachfieldmLink( id )
    return 'http://trackfield.brinkster.net/Profile.asp?ID=' .. id .. '&Gender=M'
end

function euroathleticLink( id )
    return 'https://www.european-athletics.org/athletes/group=' .. id .. '/index.html'
end

function iaafdimLink( id )
    return 'https://www.diamondleague.com/athletes/' .. id .. '.html'
end

function latatheticLink( id )
    return 'https://athletics.lv/lv/person/' .. id
end

function isuShortTrack( id )
    return 'http://www.shorttrackonline.info/skaterbio.php?id=' .. id
end

function speedskLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.speedskatingbase.eu/?section=skaters&subsection=skater&skaterid=' .. id
end

function skatingnewsLink( id )
    return 'https://www.speedskatingnews.info/skater/' .. id
end

function ibuLink( id )
    return 'http://www.biathlonworld.com/athletes/id/' .. id .. '/'
end

function biathlonLink( id )
    return 'https://www.biathlon.com.ua/profile/' .. id
end

function finaLink( id )
    return 'https://www.worldaquatics.com/athletes/' .. id .. '/wd'
end

function swimLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'https://www.swimrankings.net/index.php?page=athleteDetail&athleteId=' .. id
end

function swimhofLink( id )
    return 'https://ishof.org/' .. id .. '.html'
end

function swimswamLink( id )
    return 'https://swimswam.com/bio/' .. id .. '/'
end

function gymternetLink( id )
    return 'https://thegymter.net/' .. id .. '/'
end

function gymnforumLink( id )
    return 'http://www.gymn-forum.net/bios/' .. id .. '.html'
end

function gymnhofLink( id )
    return 'http://usghof.org/files/bio/' .. id .. '/' .. id .. '.html'
end

function ehfLink( id )
    return 'http://history.eurohandball.com/player/' .. id
end

function skatingresLink( id )
    return 'http://speedskatingresults.com/index.php?p=17&s=' .. id
end

function skatingstatsLink( id )
    return 'http://www.speedskatingstats.com/index.php?file=skater&code=' .. id
end

function iwfLink( id )
    return 'https://www.iwf.net/results/athletes/?athlete&id=' .. id
end

function iwrpLink( id )
    return 'http://iwrp.net/?view=contestant&id_zawodnik=' .. id
end

function boxrecLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'http://boxrec.com/boxer/' .. id
end

function rowLink( id )
    return 'https://worldrowing.com/athlete/' .. id
end

function icfcanoerLink( id )
    return 'https://www.canoeicf.com/athlete/' .. id
end

function fieLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://fie.org/fencers/fencer/' .. id
end

function isuLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'http://www.isuresults.com/bios/isufs' .. id .. '.htm'
end

function figLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.gymnastics.sport/site/athletes/bio_detail.php?id=' .. id
end

function cricinfoLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.espncricinfo.com/ci/content/player/' .. id .. '.html'
end

function cricarchiveLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    id2 = math.floor(tonumber(id)/1000)
    return 'http://www.cricketarchive.com/Archive/Players/' .. id2 .. '/' .. id .. '/' .. id .. '.html'
end

function ittfLink( id )
    return 'https://results.ittf.link/index.php?option=com_fabrik&view=details&formid=99&rowid=' .. id
end

function uipmLink( id )
    return 'http://www.uipmworld.org/athlete/' .. id
end

function filaLink( id )
    if not string.match( id, '^[A-Z0-9]*$' ) then
        return false
    end
    return 'https://www.iat.uni-leipzig.de/datenbanken/dbwrestling/daten.php?spid=' .. id
end

function fivbLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.fivb.org/EN/BeachVolleyball/Player_DataDB.asp?No=' .. id
end

function bvbLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.bvbinfo.com/player.asp?ID=' .. id
end

function cevLink( id )
    return 'https://www-old.cev.eu/PlayerDetail.aspx?PlayerID=' .. id
end

function wovolleyLink( id )
    return 'https://profiles.worldofvolley.com/wov-community/players/' .. id .. '.html'
end

function isafLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.sailing.org/biog?memberid=' .. id
end

function iatTriatLink( id )
    if not string.match( id, '^[A-F0-9]*$' ) then
        return false
    end
    return 'https://www.iat.uni-leipzig.de/datenbanken/dbtriathlon/daten.php?spid=' .. id
end

function iatSvarcLink( id )
    if not string.match( id, '^[A-F0-9]*$' ) then
        return false
    end
    return 'https://www.iat.uni-leipzig.de/datenbanken/dbgwh/daten.php?spid=' .. id
end

function iatDailLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'https://www.iat.uni-leipzig.de/datenbanken/dbdiving/daten.php?id_sportler=' .. id
end

function cagematchLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'http://www.cagematch.net/?id=2&nr=' .. id
end

function wrestlingdataLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://wrestlingdata.com/index.php?befehl=bios&wrestler=' .. id
end

function sherdogLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.sherdog.com/fightfinder/fightfinder.asp?FighterID=' .. id
end

function iwdLink( id )
    return 'http://www.profightdb.com/wrestlers/' .. id .. '.html'
end

function wweLink( id )
    return 'https://www.wwe.com/superstars/' .. id
end

function onlinewowLink( id )
    return 'http://www.onlineworldofwrestling.com/profile/' .. id
end

function badmintonLink( id )
    return 'https://bwf.tournamentsoftware.com/player-profile/' .. id
end

function bwfbadminLink( id )
    return 'https://bwfbadminton.com/player/' .. id
end

function issfLink( id )
    if not string.match( id, '^[A-Z0-9]*$' ) then
        return false
    end
    return 'http://www.issf-sports.org/athletes/athlete.ashx?personissfid=' .. id
end

function judoLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.judoinside.com/judoka/view/' .. id .. '/'
end

function fisALLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://data.fis-ski.com/dynamic/athlete-biography.html?sector=AL&competitorid=' .. id
end

function fisCCLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://data.fis-ski.com/dynamic/athlete-biography.html?sector=CC&competitorid=' .. id
end

function fisJPLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://data.fis-ski.com/dynamic/athlete-biography.html?sector=JP&competitorid=' .. id
end

function fisNKLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://data.fis-ski.com/dynamic/athlete-biography.html?sector=NK&competitorid=' .. id
end

function fisFSLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://data.fis-ski.com/dynamic/athlete-biography.html?sector=FS&competitorid=' .. id
end

function fisSBLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://data.fis-ski.com/dynamic/athlete-biography.html?sector=SB&competitorid=' .. id
end

function pgaLink( id )
    if not string.match( id, '^[0-9]*$' ) then
        return false
    end
    return 'http://www.pgatour.com/players/player.' .. id .. '.html'
end

function lpgaLink( id )
    return 'http://www.lpga.com/players/' .. id .. '/overview'
end

function taekwondoLink( id )
    return 'http://www.taekwondodata.com/' .. id .. '.html'
end

function lugeLink( id )
    return 'http://www.fil-luge.org/en/athletes/' .. id
end


function ibsfLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.ibsf.org/en/athlete/' .. id
end


function archeryLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'https://worldarchery.org/athlete/' .. id
end

function feiLink( id )
    if not string.match( id, '^[1-9][0-9]*$' ) then
        return false
    end
    return 'http://www.fei.org/bios/Person/' .. id
end

function dartsLink( id )
    return 'http://www.dartsdatabase.co.uk/PlayerDetails.aspx?playerKey=' .. id
end

function fmjdLink( id )
    return 'https://www.fmjd.org/?p=pcard&id=' .. id
end

function ipcLink( id )
    return 'https://www.paralympic.org/' .. id
end

function brwnbaLink( id )
    return 'https://www.basketball-reference.com/wnba/players/' .. id .. '.html'
end

function wnbaLink( id )
    return 'https://www.wnba.com/player/' .. id
end

function brnbaLink( id )
    return 'https://www.basketball-reference.com/players/' .. id .. '.html'
end

function nbaLink( id )
    return 'https://www.nba.com/stats/player/' .. id
end

function eurobasplLink( id )
    return 'https://www.eurobasket.com/player.asp?PlayerID=' .. id
end

function eurobascoLink( id )
    return 'http://www.eurobasket.com/coach.asp?CoachID=' .. id
end

function fibaLink( id )
    return 'https://archive.fiba.com/pages/eng/fa/p/rpp//q//pid/' .. id .. '/_//players.html'
end

function rbfLink( id )
    return 'https://russiabasket.ru/players/' .. id
end

function drexpLink( id )
    return 'http://www.draftexpress.com/profile/' .. id .. '/'
end

function bripLink( id )
    return 'https://www.basketball-reference.com/international/players/' .. id .. '.html'
end

function euroleagueLink( id )
    return 'https://www.euroleague.net/competition/players/showplayer?pcode=' .. id
end

function espnnbaLink( id )
    return 'https://www.espn.com/nba/player/_/id/' .. id
end

function realgmbasketLink( id )
    return 'https://basketball.realgm.com/player/wd/Summary/' .. id
end

function wcfLink( id )
    return 'http://results.worldcurling.org/Person/Details/' .. id
end

function curlingzoneLink( id )
    return 'https://www.curlingzone.com/player.php?playerid=' .. id
end

function cuetracherLink( id )
    return 'https://cuetracker.net/players/' .. id
end

function wsnookerLink( id )
    return 'https://wst.tv/players/' .. id .. '/'
end

function snookerorgLink( id )
    return 'http://www.snooker.org/res/index.asp?player=' .. id
end

function snookerdatLink( id )
    return 'https://www.snookerdatabase.co.uk/PlayerDetails.aspx?PlayerKey=' .. id
end

function driverdbLink( id )
    return 'https://www.driverdb.com/drivers/' .. id .. '/'
end

function motostatsLink( id )
    return 'https://motorsportstats.com/driver/' .. id .. '/results'
end

function racingrefdrLink( id )
    return 'https://www.racing-reference.info/driver/' .. id .. '/'
end

function racingrefraceLink( id )
    return 'https://www.racing-reference.info/race-results/' .. id .. '/'
end

function racingreftrLink( id )
    return 'https://www.racing-reference.info/tracks/' .. id .. '/'
end

function motogpLink( id )
    return 'https://www.motogp.com/en/riders/profile/' .. id
end

function wsbkLink( id )
    return 'https://www.worldsbk.com/en/rider/' .. id
end

function ewrcLink( id )
    return 'https://www.ewrc-results.com/profile/' .. id
end

function append(str, c, length)
    while str:len() < length do
        str = c .. str
    end
    return str
end

function getIdsFromWikidata( item, property )
    local ids = {}
    if not item.claims[property] then
        return ids
    end
    for _, statement in pairs( item.claims[property] ) do
		if statement.mainsnak.datavalue then
			table.insert( ids, statement.mainsnak.datavalue.value )
		end
    end
    return ids
end

function createRow( id, label, rawValue, link, lang )
    if link then
        return '* [' .. link .. ' ' .. label .. '] ' .. lang
    else
        return categories.invalid --'* <span class="error">' .. id .. ' identifikators ' .. rawValue .. ' nav derīgs.</span>' .. 
    end
end

--In this order: name of the parameter, label, propertyId in Wikidata, formatting function, language
local conf = {
	--vispārējie
    --{ 'sr', "''Sports-Reference'' profils", 1447, srLink, 'en' },
    { 'olympedia', "''Olympedia'' profils", 8286, olympediaLink, 'en' },
    { 'ipc', "SPK profils", 7550, ipcLink, 'en' },
    { 'lok', "LOK profils", 2593, lokLink, 'lv' },
    { 'sportorg', " ''The Sport.org''  profils", 4391, sportorgLink, 'en' },
    { 'munsport', " ''Munzüger Sport''  profils", 1285, munsportLink, 'de' },
	--teniss
    { 'atp', "ATP tenisista profils", 536, atpLink, 'en' },
    { 'wta', "WTA tenisistes profils", 597, wtaLink, 'en' },
    { 'itf', "ITF profils", 8618, itfLink, 'en' },
    { 'atptour', "ATP turnīra profils", 3456, atptourLink, 'en' },
    { 'wtatour', "WTA turnīra profils", 3469, wtatourLink, 'en' },
    { 'davis', "Deivisa kausa profils", 2641, davisLink, 'en' },
    { 'fedcup', "Billijas Džīnas Kingas kausa profils", 2642, fedLink, 'en' },
    { 'tennis-hof', "Starptautiskās tenisa slavas zāles profils", 3363, tennishofLink, 'en' },
    { 'tennis-temple', "''Tennis Temple'' profils", 4544, tennistempLink, 'en' },
    { 'tennisabstract', "''tennisabstract.com'' profils", 10028, tennisabstractLink, 'en' },
	--riteņbraukšana
    { 'procyc', "''ProCyclingStats'' profils", 1663, procLink, 'en' },
    { 'procycteam', "''ProCyclingStats'' komandas profils", 2328, procteamLink, 'en' },
    { 'cyc archives', "''Cycling Archives'' profils", 1409, cycaLink, 'en' },
    { 'cycquot', "''Cycling Quotient'' profils", 1541, cycqLink, 'en' },--vīrieši
    { 'cycquotw', "''Cycling Quotient'' profils", 2709, cycqwLink, 'en' },--sievietes
    { 'cycdb', "''CycleDatabase'' profils", 4508, cycdLink, 'en' },
    { 'bmx', "BMX riteņbraucēja profils", 3942, bmxLink, 'en' },
	--futbols
    --{ 'fifa', "FIFA profils", 1469, fifaLink, 'en' },
    --{ 'uefa', "UEFA profils", 2276, uefaLink, 'en' },
    { 'worldfootball', "''WorldFootball'' profils", 2020, worldfLink, 'en' },
    { 'soccerbase', "''Soccerbase'' spēlētāja profils", 2193, socbpLink, 'en' },
    { 'soccerbase tr', "''Soccerbase'' trenera profils", 2195, socbmLink, 'en' },
    { 'soccerbase team', "''Soccerbase'' komandas profils", 7454, socbteamLink, 'en' },
    { 'soccerway', "''Soccerway'' profils", 2369, soccerwayLink, 'en' },
    { 'nft', "''National-Football-Teams'' profils", 2574, nftLink, 'en' },
    { 'transf', "''Transfermarkt'' spēlētāja profils", 2446, transfpLink, 'en' },
    { 'transf tr', "''Transfermarkt'' trenera profils", 2447, transmpLink, 'en' },
    { 'transf team', "''Transfermarkt'' komandas profils", 7223, transteamLink, 'en' },
    { 'mls', "MLS profils", 2398, mlsLink, 'en' },
    { 'eurofootball', "''Eu-football.info'' profils", 3726, eurofootLink, 'en' },
    { 'stadiumDB', "''StadiumDB'' profils", 5288, stadiumLink, 'en' },
    { 'fbref', "''FBref'' spēlētāja profils", 5750, fbrefLink, 'en' },
	--šahs
    { 'fide', "FIDE profils", 1440, fideLink, 'en' },
    { 'chessg', "''Chess Games'' profils", 1665, chessLink, 'en' },
    { '365chess', "''365Chess.com'' profils", 3314, chess365Link, 'en' },
	--beisbols
    { 'br maj', "''Baseball-Reference'' MLB profils", 1825, brmajLink, 'en' },
    { 'br min', "''Baseball-Reference'' mazo līgu profils", 1826, brminLink, 'en' },
    { 'sabr', "SABR profils", 2482, sabrLink, 'en' },
	--hokejs
    { 'elitepr', "''Eliteprospects'' profils", 2481, eliteLink, 'en' },
    { 'hockeydb', "''Internet Hockey Database'' profils", 2602, hockeydbLink, 'en' },
    { 'euroh', "''Eurohockey'' profils", 2601, eurohLink, 'en' },
    { 'nhl', "NHL profils", 0, nhlLink, 'en' },
    { 'hockey-ref', "''Hockey-Reference'' profils", 3598, hockeyrefLink, 'en' },
    { 'khl', "KHL profils", 3652, khlLink, 'en' },
	--krikets
    { 'cricinfo', "''ESPNcricinfo'' profils", 2697, cricinfoLink, 'en' },
    { 'cricarchive', "''CricketArchive'' profils", 2698, cricarchiveLink, 'en' },
	--cīņas sports, mma 
    { 'cagematch', "''CageMatch'' profils", 2728, cagematchLink, 'en' },
    { 'wrestlingdata', "''Wrestlingdata'' profils", 2764, wrestlingdataLink, 'en' },
    { 'sherdog', "''Sherdog'' profils", 2818, sherdogLink, 'en' },
    { 'fila', "FILA profils", 2727, filaLink, 'en' },
    { 'iwd', "''Internet Wrestling Database'' profils", 2829, iwdLink, 'en' },
    { 'wwe', "''WWE.com superstar'' profils", 2857, wweLink, 'en' },
    { 'onlinewow', "''Online World of Wrestling'' profils", 2830, onlinewowLink, 'en' },
	--volejbols (arī pludmales)
    { 'bvbinfo', "''Beach Volleyball Database'' profils", 2800, bvbLink, 'en' },
    { 'fivbbv', "FIVB profils", 2801, fivbLink, 'en' },
    { 'cev', "CEV spēlētāja(-s) profils", 3725, cevLink, 'en' },
    { 'wovolley', "''WordofVolley'' profils", 5789, wovolleyLink, 'en' },
	--golfs
    { 'pga', "PGA profils", 2811, pgaLink, 'en' },
    { 'lpga', "LPGA profils", 2810, lpgaLink, 'en' },
	--vieglatlētika
    { 'iaaf', "''World Athletics'' profils", 1146, iaafLink, 'en' },
    { 'trachfieldf', "''Trach and Field'' vieglatlētes profils", 3924, trachfieldfLink, 'en' },
    { 'trachfieldm', "''Trach and Field'' vieglatlēta profils", 3925, trachfieldmLink, 'en' },
    --{ 'euroathletic', "''European Athletic'' profils", 3766, euroathleticLink, 'en' },
    { 'iaafdim', "Dimanta līgas profils", 3923, iaafdimLink, 'en' },
    { 'latathetic', "Latvijas vieglatlēta(-es) profils", 9399, latatheticLink, 'lv' },

        --slidošanas veidi
    { 'isu', "ISU profils", 2694, isuLink, 'en' },
    { 'speedskb', "''Speedskatingbase'' profils", 2350, speedskLink, 'en' },
    { 'isusorttreks', "''ShorttrackOnLine'' profils", 3693, isuShortTrack, 'en' },
    { 'speedskatingnews', "''SpeedSkatingNews'' profils", 3694, skatingnewsLink, 'en' },
    { 'speedskatingresults', "''SpeedSkatingResults'' profils", 4314, skatingresLink, 'en' },
    { 'SpeedSkatingStats', "''SpeedSkatingStats'' profils", 3695, skatingstatsLink, 'en' },
        --svarcelšana
    { 'iwf', "IWF profils", 3667, iwfLink, 'en' },
    { 'iwrp', "IWRP profils", 4504, iwrpLink, 'en' },
        --biatlons
    { 'ibu', "IBU profils", 2459, ibuLink, 'en' },
    { 'biathlon', "''biathlon.com.ua'' profils", 6386, biathlonLink, 'uk' },
        --ūdenssports
    { 'fina', "''World Aquatics'' profils", 3408, finaLink, 'en' },
    { 'swimr', "''Swimrankings'' profils", 2640, swimLink, 'en' },
    { 'swimhof', "Starptautiskās peldēšanas slavas zāles profils", 3691, swimhofLink, 'en' },
    { 'swimswam', "''SwimSwam'' profils", 4315, swimswamLink, 'en' },
    { 'iatdailleksana', "''Institut für Angewandte Trainingswissenschaft'' profils", 2780, iatDailLink, 'de' },
        --vingrošana
    { 'fig', "FIG profils", 7440, figLink, 'en' },
    { 'gymternet', "''The Gymternet'' vingrotāja(-s) profils", 5788, gymternetLink, 'en' },
    { 'gymnforum', "''Gymn Forum'' profils", 4546, gymnforumLink, 'en' },
    { 'gymnhof', "Vingrošanas Slavas zāles profils", 4583, gymnhofLink, 'en' },
        --airēšana
    { 'wrowing', "''WorldRowing'' profils", 8990, rowLink, 'en' },
    { 'icfcanoer', "ICF profils", 3689, icfcanoerLink, 'en' },
        --badmintons
    { 'bwf', "BWF profils", 2729, badmintonLink, 'en' },
    { 'bwfbadmin', "''BWF badminton.com'' profils", 3620, bwfbadminLink, 'en' },
        --citi sporta veidi
    { 'ehf', "EHF handbolista(-es) profils", 3573, ehfLink, 'en' },
    { 'boxrec', "''BoxRec'' profils", 1967, boxrecLink, 'en' },
    { 'fie', "FIE profils", 2423, fieLink, 'en' },-- paukošana
    { 'ittf', "ITTF profils", 1364, ittfLink, 'en' },-- galda teniss
    { 'uipm', "UIPM profils", 2726, uipmLink, 'en' },-- modernā pieccīņa
    { 'iattriatlons', "''Institut für Angewandte Trainingswissenschaft'' profils", 2778, iatTriatLink, 'en' },
    { 'iatsvarcelsana', "''Institut für Angewandte Trainingswissenschaft'' profils", 2779, iatSvarcLink, 'de' },
    { 'issf', "ISSF profils", 2730, issfLink, 'en' },-- šaušana
    { 'isaf', "ISAF profils", 2804, isafLink, 'en' },-- burāšana
    { 'judo', "''JudoInside'' profils", 2767, judoLink, 'en' },
    { 'taekwondo', "''Taekwondo Data'' profils", 2987, taekwondoLink, 'en' },
    { 'luge', "FIL profils", 2990, lugeLink, 'en' },-- kamaniņas
    { 'ibsf', "IBSF profils", 2991, ibsfLink, 'en' },--bobslejs, skeletons
    { 'archery', "''World Archery'' profils", 3010, archeryLink, 'en' },-- loka šaušana
    { 'fei', "FEI profils", 3111, feiLink, 'en' },--jāšana
    { 'darts', "''Darts Database'' profils", 3621, dartsLink, 'en' },--šautriņu mešana
    { 'fmjd', "FMJD profils", 0, fmjdLink, 'en' },--dambrete
	--FIS
    { 'fisal', "FIS profils (kalnu slēpošana)", 2772, fisALLink, 'en' },
    { 'fiscc', "FIS profils (distanču slēpošana)", 2773, fisCCLink, 'en' },
    { 'fisfs', "FIS profils (frīstaila slēpošana)", 2774, fisFSLink, 'en' },
    { 'fisjp', "FIS profils (tramplīnlēkšana)", 2775, fisJPLink, 'en' },
    { 'fisnk', "FIS profils (ziemeļu divcīņa)", 2776, fisNKLink, 'en' },
    { 'fissb', "FIS profils (snovbords)", 2777, fisSBLink, 'en' },
    { 'espn', "ESPN profils", 0, espnLink, 'en' },
    --basketbols
    { 'brwnba', "''Basketball Reference'' WNBA spēlētājas profils", 4561, brwnbaLink, 'en' },
    { 'wnba', "WNBA spēlētājas profils", 3588, wnbaLink, 'en' },
    { 'brnba', "''Basketball Reference'' NBA spēlētāja profils", 2685, brnbaLink, 'en' },
    { 'nba', "NBA spēlētāja profils", 3647, nbaLink, 'en' },
    { 'drexp', "''DraftExpress'' profils", 3533, drexpLink, 'en' },
    { 'eurobasket-pl', "''Eurobasket'' spēlētāja(-s) profils", 3527, eurobasplLink, 'en' },
    { 'eurobasket-co', "''Eurobasket'' trenera(-es) profils", 6865, eurobascoLink, 'en' },
    { 'brip', "''Basketball Reference'' spēlētāja(-s) profils", 4790, bripLink, 'en' },
    { 'fiba', "''FIBA ARCHIVE'' profils", 3542, fibaLink, 'en' },
    { 'rbf', "''Russiabasket'' profils", 5969, rbfLink, 'ru' },
    { 'euroleague', "Eirolīgas profils", 3536, euroleagueLink, 'en' },
    { 'espnnba', "ESPN NBA profils", 3685, espnnbaLink, 'en' },
    { 'realgmbasket', "''RealGM Basketball'' profils", 3957, realgmbasketLink, 'en' },
    --kērlings
    { 'wcf', "WCF kērlingista(-es) profils", 3557, wcfLink, 'en' },
    { 'curlingzone', "''CurlingZone'' profils", 3556, curlingzoneLink, 'en' },
    --snūkers
    { 'cuetracher', "''CueTracker'' snūkerista(-es) profils", 3830, cuetracherLink, 'en' },
    { 'wsnooker', "''World Snooker'' profils", 4498, wsnookerLink, 'en' },
    { 'snookerorg', "''Snooker.org'' snūkerista(-es) profils", 4502, snookerorgLink, 'en' },
    { 'snookerdat', "''Snooker Database'' snūkerista(-es) profils", 4538, snookerdatLink, 'en' },
    --motosports
    { 'driverdb', "''Driver Database'' profils", 3684, driverdbLink, 'en' },
    { 'motostats', "''Motorsportstats'' profils", 8140, motostatsLink, 'en' },
    { 'racingrefdr', "''Racing-Reference driver'' profils", 3048, racingrefdrLink, 'en' },
    { 'racingrefrace', "''Racing-Reference race'' profils", 6806, racingrefraceLink, 'en' },
    { 'racingreftr', "''Racing-Reference track'' profils", 6807, racingreftrLink, 'en' },
    { 'motogp', "''MotoGP'' profils", 3928, motogpLink, 'en' },
    { 'wsbk', "''WorldSBK.com'' profils", 4076, wsbkLink, 'en' },
    { 'ewrc', "''eWRC-results.com'' profils", 3927, ewrcLink, 'en' },
}
-- parametru kā pēdējo likt, lai var ielikt arī alias

local p = {}

function p.main( frame )
    local parentArgs = frame:getParent().args
    --Create rows
    local elements = {}

    --Wikidata fallback if requested
	local item = mw.wikibase.getEntityObject()
	if item and item.claims then
		for _, params in pairs( conf ) do
			params[6] = ''
			if params[3] ~= 0 then
				local val = parentArgs[params[1]]
				if not val or val == '' then
					local wikidataIds = getIdsFromWikidata( item, 'P' .. params[3] )
					if wikidataIds[1] then
						parentArgs[params[1]] = wikidataIds[1]
					end
				else
					params[6] = categories.localpar
				end
		else
			local val = parentArgs[params[1]]
			if val then
					params[6] = categories.localpar
				end
			end
		end
	end

	--Configured rows
	local rct = 0
	for k, params in pairs( conf ) do
		local val = parentArgs[params[1]]
		if val and val ~= '' then
			local icon = ''
			if params[5] and params[5] ~= '' and params[5] ~= 'lv' then
				icon = frame:expandTemplate{ title = params[5] .. " ikona" }
			end
			table.insert( elements, createRow( params[1], params[2], val, params[4]( val ), icon ) .. (params[6] or '') )
			rct = rct + 1
		end
	end

	if rct == 0 then
		return categories.empty
	else
		return table.concat( elements, "\n" )
	end
end

return p