https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3AISO3166%2FloadData Modul:ISO3166/loadData - Versionsgeschichte 2025-07-12T06:08:35Z Versionsgeschichte dieser Seite in Wikipedia MediaWiki 1.45.0-wmf.9 https://de.wikipedia.org/w/index.php?title=Modul:ISO3166/loadData&diff=193365569&oldid=prev Funkruf: Schützte „Modul:ISO3166/loadData“: Wunsch auf WP:A/AF https://de.wikipedia.org/w/index.php?title=Wikipedia:Administratoren/Anfragen&diff=prev&oldid=193363492&diffmode=source ([Bearbeiten=Nur Sichter] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt)) 2019-10-22T16:18:26Z <p>Schützte „<a href="/wiki/Modul:ISO3166/loadData" title="Modul:ISO3166/loadData">Modul:ISO3166/loadData</a>“: Wunsch auf WP:A/AF https://de.wikipedia.org/w/index.php?title=Wikipedia:Administratoren/Anfragen&amp;diff=prev&amp;oldid=193363492&amp;diffmode=source ([Bearbeiten=Nur Sichter] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt))</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <tr class="diff-title" lang="de"> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Version vom 22. Oktober 2019, 18:18 Uhr</td> </tr><tr><td colspan="2" class="diff-notice" lang="de"><div class="mw-diff-empty">(kein Unterschied)</div> </td></tr></table> Funkruf https://de.wikipedia.org/w/index.php?title=Modul:ISO3166/loadData&diff=193119794&oldid=prev PerfektesChaos: 2019-10-13 2019-10-14T12:39:09Z <p>2019-10-13</p> <p><b>Neue Seite</b></p><div>local ISO3166 = { suite = &quot;ISO3166&quot;,<br /> sub = &quot;loadData&quot;,<br /> serial = &quot;2019-10-13&quot;,<br /> join = 70862569,<br /> main = 69799761,<br /> codes = { } }<br /> --[=[<br /> Create ISO 3166 mw.loadData() table<br /> ]=]<br /> <br /> <br /> <br /> local fetch = function ( achieve, alert )<br /> -- Retrieve data from Commons .tab JSON<br /> -- Precondition:<br /> -- achieve -- string, with name of Commons tab<br /> -- alert -- true, for throwing error on data problem<br /> -- Returns table, with mapping string-&gt;string<br /> local storage = string.format( &quot;ISO3166/%s.tab&quot;, achieve )<br /> local lucky, data = pcall( mw.ext.data.get, storage )<br /> local r = { }<br /> local s<br /> if type( data ) == &quot;table&quot; and<br /> type( data.data ) == &quot;table&quot; then<br /> local entry, sign, set<br /> data = data.data<br /> for i = 1, #data do<br /> entry = data[ i ]<br /> if type( entry ) == &quot;table&quot; then<br /> sign = entry[ 1 ]<br /> if type( sign ) == &quot;string&quot; then<br /> if r[ sign ] then<br /> s = string.format( &quot;Duplicated: %s (%d) @%s&quot;,<br /> sign, i, achieve )<br /> else<br /> set = entry[ 2 ]<br /> if type( set ) == &quot;string&quot; then<br /> r[ sign ] = set<br /> if alert then<br /> if mw.text.trim( sign ) ~= sign or<br /> sign:upper() ~= sign or<br /> sign == &quot;&quot; then<br /> s = string.format( &quot;%s &#039;%s&#039; @%s&quot;,<br /> &quot;Bad key:&quot;,<br /> sign, achieve )<br /> end<br /> if mw.text.trim( set ) ~= set or<br /> set:upper() ~= set or<br /> set == &quot;&quot; then<br /> s = string.format( &quot;%s %s:&#039;%s&#039; @%s&quot;,<br /> &quot;Bad value:&quot;,<br /> sign, set,<br /> achieve )<br /> end<br /> end<br /> else<br /> s = string.format( &quot;Invalid value: %s @%s&quot;,<br /> sign, achieve )<br /> end<br /> end<br /> else<br /> s = string.format( &quot;Bad entry (%d) @%s&quot;, i, achieve )<br /> end<br /> else<br /> s = string.format( &quot;Invalid entry (%d) @%s&quot;, i, achieve )<br /> end<br /> end -- for i<br /> else<br /> s = &quot;Missing or invalid page: commons:&quot; .. storage<br /> end<br /> if s and alert then<br /> error( s, 0 )<br /> end<br /> return r<br /> end -- fetch()<br /> <br /> <br /> <br /> ISO3166.codes = fetch( &quot;codes&quot; )<br /> ISO3166.reverse = fetch( &quot;reverse&quot; )<br /> ISO3166.failsafe = ISO3166.serial<br /> <br /> <br /> <br /> return ISO3166</div> PerfektesChaos