https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AOSM
Modul:OSM - Versionsgeschichte
2025-05-24T19:20:52Z
Versionsgeschichte dieser Seite in Wikipedia
MediaWiki 1.45.0-wmf.2
https://de.wikipedia.org/w/index.php?title=Modul:OSM&diff=145957326&oldid=prev
Polyglot: mehrere Werte in die Daten sind möglich
2015-09-12T05:27:55Z
<p>mehrere Werte in die Daten sind möglich</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 12. September 2015, 07:27 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 12:</td>
<td colspan="2" class="diff-lineno">Zeile 12:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:' .. args.timeout .. '][out:json];\n'</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:' .. args.timeout .. '][out:json];\n'</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:<del style="font-weight: bold; text-decoration: none;">15</del>][out:json];\n'</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> timeout = '[timeout:<ins style="font-weight: bold; text-decoration: none;">20</ins>][out:json];\n'</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.link and args.link == 'no' then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.link and args.link == 'no' then</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 41:</td>
<td colspan="2" class="diff-lineno">Zeile 41:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> itemID = itemObject.id</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> itemID = itemObject.id</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker"><a class="mw-diff-movedpara-right" title="Der Absatz wurde verschoben. Klicken, um zur alten Stelle zu springen." href="#movedpara_10_0_lhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_3_0_rhs"></a><ins style="font-weight: bold; text-decoration: none;"> </ins>-- <ins style="font-weight: bold; text-decoration: none;">Always</ins> perform a regular expression based search</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> if itemID:find(";") == nil then</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- It happens that multiple values are in the data</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- If there are no ; in the itemID, we only need to search for 1 value</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"> </del>itemID = '"<del style="font-weight: bold; text-decoration: none;">=</del>"' .. itemID</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> </ins>itemID = '"<ins style="font-weight: bold; text-decoration: none;">~</ins>"<ins style="font-weight: bold; text-decoration: none;">(^|;)(</ins>' .. itemID<ins style="font-weight: bold; text-decoration: none;">:gsub(";", "\|") .. ')(;|$)'</ins></div></td>
</tr>
<tr>
<td colspan="2" class="diff-empty diff-side-deleted"></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><br /></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> else</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"><a class="mw-diff-movedpara-left" title="Der Absatz wurde verschoben. Klicken, um zur neuen Stelle zu springen." href="#movedpara_3_0_rhs">⚫</a></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><a name="movedpara_10_0_lhs"></a><del style="font-weight: bold; text-decoration: none;"> </del>-- <del style="font-weight: bold; text-decoration: none;">If more than 1 Q-number is provided,</del> perform a regular expression based search<del style="font-weight: bold; text-decoration: none;"> instead</del></div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> itemID = '"~"^(' .. itemID:gsub(";", "\|") .. ')$'</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td colspan="2" class="diff-empty diff-side-added"></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.query then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if args.query then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- user can add their own tags to filter on</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> -- user can add their own tags to filter on</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 105:</td>
<td colspan="2" class="diff-lineno">Zeile 102:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if logo then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if logo then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;"> </del> style = "node [".. target .."]{\n text: name;\n".. logo .. " icon-width: 32;}"</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> style = "node [".. target .."]{\n text: name;\n".. logo .. " icon-width: 32;}"</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> <del style="font-weight: bold; text-decoration: none;"> </del> end</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if style then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if style then</div></td>
</tr>
<!-- diff cache key dewiki:diff:1.41:old-145177928:rev-145957326:wikidiff2=table:1.14.1:ff290eae -->
</table>
Polyglot
https://de.wikipedia.org/w/index.php?title=Modul:OSM&diff=145177928&oldid=prev
Polyglot: Entwickelt auf nl WP und en WP
2015-08-19T05:38:00Z
<p>Entwickelt auf nl WP und en WP</p>
<p><b>Neue Seite</b></p><div>local function buildquery(frame, target)<br />
local textToDisplay, leftLink, rightLink, runQueryRightAway, itemObject, itemID, query, coord, bbox, remark, overpassUrl, primitives, timeout, style, logo<br />
local args = frame.args<br />
<br />
if args.display then<br />
-- text to display on link<br />
textToDisplay = ' ' .. args.display<br />
else<br />
textToDisplay = ''<br />
end<br />
if args.timeout then<br />
timeout = '[timeout:' .. args.timeout .. '][out:json];\n'<br />
else<br />
timeout = '[timeout:15][out:json];\n'<br />
end<br />
if args.link and args.link == 'no' then<br />
-- just return the url<br />
leftLink = ''<br />
rightLink = ''<br />
textToDisplay = ''<br />
else<br />
leftLink = '['<br />
rightLink = ']'<br />
end<br />
if args.run and args.run == 'no' then<br />
-- don't run immediately<br />
runQueryRightAway = ''<br />
else<br />
runQueryRightAway = '&R'<br />
end<br />
if args.id then<br />
-- build query for specific Q-item(s) <br />
itemID = args.id<br />
pcall(function () itemObject = mw.wikibase.getEntityObject(mw.text.split(itemID,";")[1]) end)<br />
else<br />
itemObject = mw.wikibase.getEntityObject()<br />
if itemObject == nil then<br />
return "This page doesn't have a wikidata entry"<br />
end<br />
-- build query for current page<br />
itemID = itemObject.id<br />
end<br />
if itemID:find(";") == nil then<br />
-- If there are no ; in the itemID, we only need to search for 1 value<br />
itemID = '"="' .. itemID<br />
else<br />
-- If more than 1 Q-number is provided, perform a regular expression based search instead<br />
itemID = '"~"^(' .. itemID:gsub(";", "\|") .. ')$'<br />
end<br />
if args.query then<br />
-- user can add their own tags to filter on<br />
query = args.query<br />
else<br />
query = ''<br />
end<br />
if args.coord and not(args.limitToBBOX=='no') then<br />
-- The user can provide coordinates and a zoom factor<br />
coord = '&C=' .. args.coord<br />
-- In that case we can limit the search to the area in view<br />
bbox = '({{bbox}})'<br />
-- and tell them how to search wider.<br />
remark = ' // remove the ' .. bbox .. 'if you want the query to be executed globally'<br />
else<br />
coord = ''<br />
bbox = ''<br />
remark = ''<br />
end<br />
overpassUrl = timeout .. '(\n'<br />
-- if the user specifies prim(itives), but then leaves the string empty, abort<br />
if args.prim then<br />
if args.prim == '' then<br />
return "Please indicate which primitives you want to query for"<br />
end<br />
primitives = args.prim<br />
else<br />
primitives = 'nwr'<br />
end<br />
<br />
if primitives:find("n") then<br />
-- Include nodes<br />
overpassUrl = overpassUrl .. 'node["' .. target .. itemID ..'"]' .. query .. bbox .. ';' .. remark .. '\n'<br />
end<br />
if primitives:find("w") then<br />
-- Include ways<br />
overpassUrl = overpassUrl .. 'way["' .. target .. itemID .. '"]' .. query .. bbox .. ';\n'<br />
end<br />
if primitives:find("r") then<br />
-- Include relations<br />
overpassUrl = overpassUrl .. 'relation["' .. target .. itemID .. '"]' .. query .. bbox .. ';\n>>;\n'<br />
end <br />
overpassUrl = overpassUrl .. ');\n'<br />
overpassUrl = overpassUrl .. 'out geom;\n'<br />
if args.style then<br />
style = args.style<br />
else<br />
if args.logo then<br />
logo = " icon-image: url(" .. args.logo .. ');\n'<br />
else<br />
if itemObject then<br />
logo = tostring(itemObject:formatPropertyValues('P154')['value']):gsub("&#39;", "'")<br />
end<br />
if logo and not(logo == '') then<br />
logo = ' icon-image: url("https://commons.wikimedia.org/wiki/Special:Redirect/file/'.. logo .. '");\n'<br />
end<br />
end<br />
if logo then<br />
style = "node [".. target .."]{\n text: name;\n".. logo .. " icon-width: 32;}"<br />
end<br />
end<br />
if style then<br />
overpassUrl = overpassUrl .. '{{style:\n' .. style .. '\n}}\n'<br />
end<br />
<br />
return leftLink .. 'http://overpass-turbo.eu/?Q=' .. mw.uri.encode(overpassUrl, "PATH" ) .. coord .. runQueryRightAway .. textToDisplay .. rightLink<br />
end<br />
<br />
local p = {}<br />
<br />
function p.overpass( frame )<br />
return buildquery(frame, '')<br />
end<br />
<br />
function p.wd( frame )<br />
return buildquery(frame, 'wikidata')<br />
end<br />
<br />
function p.pt( frame )<br />
frame.args.style = "node {\n opacity: 0;\n fill-opacity: 0;}\nnode[highway=bus_stop], way[highway=bus_stop]{\n text: name;\n icon-image: url('icons/maki/bus-18.png');\n icon-width: 18;}"<br />
frame.args.prim = "r"<br />
frame.args.timeout = 50<br />
return buildquery(frame, 'wikidata')<br />
end<br />
<br />
function p.etym( frame )<br />
return buildquery(frame, 'name:etymology:wikidata')<br />
end<br />
<br />
function p.subject( frame )<br />
return buildquery(frame, 'subject:wikidata')<br />
end<br />
<br />
function p.artist( frame )<br />
return buildquery(frame, 'artist:wikidata')<br />
end<br />
<br />
function p.architect( frame )<br />
return buildquery(frame, 'architect:wikidata')<br />
end<br />
<br />
function p.operator( frame )<br />
return buildquery(frame, 'operator:wikidata')<br />
end<br />
<br />
function p.brand( frame )<br />
return buildquery(frame, 'brand:wikidata')<br />
end<br />
<br />
return p</div>
Polyglot