Changes

Jump to navigation Jump to search

Module:Authority control

1,585 bytes added, 17:05, 28 November 2018
IMDb
id = parts[1] .. parts[2] .. p.append( parts[3], '0', 6 )
return '[https://id.loc.gov/authorities/'..lccnType..'/'..id..' '..id..']'..p.getCatForId( 'LCCN' )
end
 
function p.imdbLink( id )
local imdbType = string.sub(id, 1, 2)
--P345's format regex: ev\d{7}\/(19|20)\d{2}(-\d)?|(ch|co|ev|tt|nm)\d{7}|(ni|nm)\d{8} (e.g. nm01234567)
if imdbType == 'nm' then
if not string.match( id, '^nm%d%d%d%d%d%d%d%d?$' ) then
return false
end
return '[https://www.imdb.com/name/'..id..'/ '..id..']'..p.getCatForId( 'IMDB' )
elseif imdbType == 'tt' then
if not string.match( id, '^tt%d%d%d%d%d%d%d$' ) then
return false
end
return '[https://www.imdb.com/title/'..id..'/ '..id..']'..p.getCatForId( 'IMDB' )
elseif imdbType == 'ch' then -- since Wikidata kept these, retaining them as Wikidata has done
if not string.match( id, '^ch%d%d%d%d%d%d%d$' ) then
return false
end
return '[https://web.archive.org/web/https://www.imdb.com/character/'..id..'/ '..id..']'..p.getCatForId( 'IMDB' )
elseif imdbType == 'ev' then
if not (string.match( id, '^ev%d%d%d%d%d%d%d$' )
or string.match( id, '^ev%d%d%d%d%d%d%d/%d%d%d%d$' )
or string.match( id, '^ev%d%d%d%d%d%d%d/%d%d%d%d%-%d$' )) then
return false
end
return '[https://www.imdb.com/event/'..id..' '..id..']'..p.getCatForId( 'IMDB' )
elseif imdbType == 'co' then
if not string.match( id, '^co%d%d%d%d%d%d%d$' ) then
return false
end
return '[https://www.imdb.com/company/'..id..'/ '..id..']'..p.getCatForId( 'IMDB' )
elseif imdbType == 'ni' then
if not string.match( id, '^ni%d%d%d%d%d%d%d%d?$' ) then
return false
end
return '[https://www.imdb.com/news/'..id..'/ '..id..']'..p.getCatForId( 'IMDB' )
end
end
{ 'IAAF', '[[International Association of Athletics Federations|IAAF]]', 1146, p.iaafLink },
{ 'ICIA', '[[Information Center for Israeli Art|ICIA]]', 1736, p.iciaLink },
{ 'IMDb', '[[IMDb]]', 345, p.imdbLink },
{ 'ISNI', '[[International Standard Name Identifier|ISNI]]', 213, p.isniLink },
{ 'Joconde', '[[Joconde|Joconde]]' , 347, p.jocondeLink },
Anonymous user

Navigation menu