Difference between revisions of "Module:LatestAfD"
Jump to navigation
Jump to search
blackwiki>Swpb |
blackwiki>Swpb |
||
| Line 4: | Line 4: | ||
local page = frame.args[1] | local page = frame.args[1] | ||
| − | + | base_string = "Wikipedia:Articles for deletion/" .. page | |
| + | base_title = mw.title.new(base_string) | ||
| + | if not base_title.exists then | ||
| + | return "Error, no AfD exists" | ||
| + | end | ||
| + | |||
| + | afd_num = 1 | ||
latest = false | latest = false | ||
while not latest do | while not latest do | ||
| − | page_title = mw.title.new( | + | page_title = mw.title.new(base_string) |
if page_title.exists then | if page_title.exists then | ||
return "[[" .. page_string .. "]]" | return "[[" .. page_string .. "]]" | ||
Revision as of 17:53, 30 May 2017
local p = {}
function p.latestafd(frame)
local page = frame.args[1]
base_string = "Wikipedia:Articles for deletion/" .. page
base_title = mw.title.new(base_string)
if not base_title.exists then
return "Error, no AfD exists"
end
afd_num = 1
latest = false
while not latest do
page_title = mw.title.new(base_string)
if page_title.exists then
return "[[" .. page_string .. "]]"
end
end
end
return p