Content deleted Content added
MusikBot II (talk | contribs) m Protected "Module:YouTubeSubscribers": High-risk template or module: 2510 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite)) |
Trimmed redundancy, made code easier to read, and fixed a minor error from attempting to escape a character with a backslash like in Regex. If this edit somehow breaks Wikipedia, please inform me via trout. |
||
Line 37:
if i then
-- year
parts[index] = tonumber(mw.ustring.gsub(dateStr:sub(ptr, i-1), "^
if parts[index] == -0 then
Line 87:
if aY < bY then
return true
▲ if aY > bY then
return false
▲ if aM < bM then
return true
▲ if aM > bM then
return false
▲ if aD < bD then
return true
end
Line 179 ⟶ 171:
qid = mw.wikibase.getEntityIdForCurrentPage()
end
▲ error("No qid found for page. Please make a Wikidata item for this article")
local e = mw.wikibase.getEntity(qid)
▲ error("No such item found: " .. qid)
return e
end
Line 209 ⟶ 197:
local e = getEntity(frame)
local chanId = getBestYtChanId(e)
▲ error("Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred")
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId)
if s then
|