Content deleted Content added
add code to detect the rank of URLs from Wikidata |
move tracking category for no URL into the renderTrackingCategory function; this prevents it from being output in namespaces other than the main namespace |
||
Line 2:
local p = {}
end▼
-- Wrapper for pcall which returns nil on failure.
Line 48 ⟶ 43:
-- Render the URL link, plus other visible output.
local function renderUrl(options)
if not options.url then▼
return '<strong class="error">' ..▼
'No URL found. Please specify a URL here or add one to Wikidata.' ..▼
▲ end
local ret = {}
ret[#ret + 1] = string.format(
Line 71:
end
local category
if
elseif fetchWikidataUrl() then
if url and url ~= fetchWikidataUrl() then
category = 'Official website different in Wikidata and Wikipedia'
Line 78 ⟶ 80:
category = 'Official website not in Wikidata'
end
return category and
end
function p._main(args)
local url = args[1] or args.___URL or fetchWikidataUrl()
▲ if not url then
▲ return '<strong class="error">' ..
▲ 'No URL found. Please specify a URL here or add one to Wikidata.' ..
▲ '</strong>' ..
▲ makeCategory('Official website missing URL')
local formattedUrl = renderUrl{
url = url,
|