Content deleted Content added
factor out geohack url generating code |
fix bugs |
||
Line 396:
-- generate URL of geohack map
local function geohack(
-- create geohack link. Example:
-- https://geohack.toolforge.org/geohack.php?pagename=Mount_Whitney¶ms=36.578580925_N_118.29199495_W_type:mountain_region:US-CA_scale:100000_source:NGS
local url = 'https://geohack.toolforge.org/geohack.php?'
local
local namearg = main_args["name"]
local current_page = mw.title.getCurrentTitle()
local pagename = mw.uri.encode( current_page.prefixedText, 'WIKI' )
Line 417:
url = url..mw.ustring.format('%.6f',LL.long)..'_E'
end
for
url = url..'_'..
end
if not mw.ustring.find(input,"region") and LL.region then
Line 434:
end
function oscoord._main(
local input =
if empty(input) then
return warning(nil)
end
local linktitle =
local rawurl = yesno(
local args = split(input,'_')
local LL
Line 472:
return linktitle ..warning(LL.err)
end
local other_args = {}
local url = geohack(input, args, LL, restargs)▼
for i = restargs, #args do
table.append(other_args, args[i])
end
if not rawurl then
url = '['..url..' '..linktitle..']'
|