Difference between revisions of "Most active countries"

From Geohashing
(updating stats *** existing text overwritten ***)
(updating stats *** existing text overwritten ***)
Line 10: Line 10:
 
!#!!Country!!Σ!!25!!24!!23!!22!!21!!20!!19!!18!!17!!16!!15!!14!!13!!12!!11!!10!!09!!08
 
!#!!Country!!Σ!!25!!24!!23!!22!!21!!20!!19!!18!!17!!16!!15!!14!!13!!12!!11!!10!!09!!08
 
|-
 
|-
|1||{{flag|US}} [[:Category:Meetup in the United States of America|United States of America]]||5763||46||178||204||178||149||195||120||144||156||234||288||348||577||608||371||573||765||629
+
|1||{{flag|US}} [[:Category:Meetup in the United States of America|United States of America]]||5764||47||178||204||178||149||195||120||144||156||234||288||348||577||608||371||573||765||629
 
|-
 
|-
 
|2||{{flag|DE}} [[:Category:Meetup in Germany|Germany]]||5389||66||393||449||278||347||255||259||219||186||249||368||410||286||314||333||283||508||186
 
|2||{{flag|DE}} [[:Category:Meetup in Germany|Germany]]||5389||66||393||449||278||347||255||259||219||186||249||368||410||286||314||333||283||508||186
Line 16: Line 16:
 
|3||{{flag|GB}} [[:Category:Meetup in the United Kingdom|United Kingdom]]||1489||8||54||25||23||9||33||29||41||46||187||327||52||98||167||113||105||124||48
 
|3||{{flag|GB}} [[:Category:Meetup in the United Kingdom|United Kingdom]]||1489||8||54||25||23||9||33||29||41||46||187||327||52||98||167||113||105||124||48
 
|-
 
|-
|4||{{flag|AU}} [[:Category:Meetup in Australia|Australia]]||1009||24||98||94||94||50||26||17||15||24||29||36||29||81||97||40||54||102||99
+
|4||{{flag|AU}} [[:Category:Meetup in Australia|Australia]]||1010||25||98||94||94||50||26||17||15||24||29||36||29||81||97||40||54||102||99
 
|-
 
|-
 
|5||{{flag|FI}} [[:Category:Meetup in Finland|Finland]]||673||1||23||19||13||25||45||27||26||33||49||63||92||92||35||35||52||23||20
 
|5||{{flag|FI}} [[:Category:Meetup in Finland|Finland]]||673||1||23||19||13||25||45||27||26||33||49||63||92||92||35||35||52||23||20
Line 178: Line 178:
 
|1||{{flag|DE}} [[:Category:Meetup in Germany|Germany]]||4790||57||346||424||251||312||238||230||200||166||220||331||353||252||275||293||240||447||155
 
|1||{{flag|DE}} [[:Category:Meetup in Germany|Germany]]||4790||57||346||424||251||312||238||230||200||166||220||331||353||252||275||293||240||447||155
 
|-
 
|-
|2||{{flag|US}} [[:Category:Meetup in the United States of America|United States of America]]||4302||39||135||169||144||110||145||95||99||125||177||228||278||436||438||267||427||588||402
+
|2||{{flag|US}} [[:Category:Meetup in the United States of America|United States of America]]||4303||40||135||169||144||110||145||95||99||125||177||228||278||436||438||267||427||588||402
 
|-
 
|-
 
|3||{{flag|GB}} [[:Category:Meetup in the United Kingdom|United Kingdom]]||1231||6||47||22||18||7||21||24||33||40||164||285||44||82||132||95||84||101||26
 
|3||{{flag|GB}} [[:Category:Meetup in the United Kingdom|United Kingdom]]||1231||6||47||22||18||7||21||24||33||40||164||285||44||82||132||95||84||101||26
 
|-
 
|-
|4||{{flag|AU}} [[:Category:Meetup in Australia|Australia]]||806||22||91||87||82||44||24||15||11||20||24||26||22||59||53||35||44||69||78
+
|4||{{flag|AU}} [[:Category:Meetup in Australia|Australia]]||807||23||91||87||82||44||24||15||11||20||24||26||22||59||53||35||44||69||78
 
|-
 
|-
 
|5||{{flag|FI}} [[:Category:Meetup in Finland|Finland]]||629||0||21||17||12||23||43||26||26||33||49||62||87||82||31||32||49||20||16
 
|5||{{flag|FI}} [[:Category:Meetup in Finland|Finland]]||629||0||21||17||12||23||43||26||26||33||49||62||87||82||31||32||49||20||16

Revision as of 00:04, 26 March 2025

The following table shows countries by their number of reached and total expeditions as of 2025-03.

Methodology and Limitations

For the purpose of this list, a country is defined as anything that has a ISO 3166-1 code.

This page is generated by looking where location templates are transcluded, and at the expeditions category and the coordinates reached category. This page is only as good as those categories.

Check out the program's source code.

Expeditions

# Country Σ 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08
1 🇺🇸 United States of America 5764 47 178 204 178 149 195 120 144 156 234 288 348 577 608 371 573 765 629
2 🇩🇪 Germany 5389 66 393 449 278 347 255 259 219 186 249 368 410 286 314 333 283 508 186
3 🇬🇧 United Kingdom 1489 8 54 25 23 9 33 29 41 46 187 327 52 98 167 113 105 124 48
4 🇦🇺 Australia 1010 25 98 94 94 50 26 17 15 24 29 36 29 81 97 40 54 102 99
5 🇫🇮 Finland 673 1 23 19 13 25 45 27 26 33 49 63 92 92 35 35 52 23 20
6 🇨🇦 Canada 567 0 18 12 6 7 16 5 12 10 6 11 20 29 36 56 110 120 93
7 🇳🇱 Netherlands 488 6 54 26 23 19 22 20 18 28 34 45 42 22 52 10 9 16 42
8 🇸🇪 Sweden 422 0 0 2 4 7 13 8 1 4 5 8 14 26 118 77 60 49 26
9 🇨🇭 Switzerland 304 5 29 32 6 7 18 1 2 3 11 12 14 55 41 32 14 16 6
10 🇫🇷 France 285 0 32 40 35 38 24 7 2 10 6 3 15 14 15 11 7 18 8
11 🇮🇱 Israel 229 15 55 40 19 25 5 9 25 13 0 0 1 4 6 3 0 8 1
12 🇵🇱 Poland 205 1 4 37 5 9 8 4 7 8 5 24 16 33 13 6 18 4 3
13 🇳🇴 Norway 165 3 13 29 33 2 2 1 0 0 0 3 4 0 16 10 27 2 20
14 🇳🇿 New Zealand 164 0 2 10 4 1 3 3 10 6 8 16 15 5 12 16 28 7 18
15 🇪🇸 Spain 154 0 4 10 43 49 1 1 5 0 2 4 4 10 8 2 4 5 2
16 🇦🇹 Austria 145 3 4 4 6 4 2 1 2 5 8 26 48 15 2 3 5 4 3
17 🇷🇺 Russia 106 0 0 2 1 17 4 1 0 3 4 2 6 42 21 2 1 0 0
18 🇨🇿 Czechia 64 7 3 1 0 0 0 0 1 0 0 13 4 4 8 5 6 7 5
19 🇮🇹 Italy 63 0 4 4 0 2 0 0 1 0 1 7 6 12 9 4 8 4 1
20 🇸🇬 Singapore 47 0 3 4 3 1 1 0 1 5 2 0 2 5 4 7 0 2 7
21 🇩🇰 Denmark 45 0 2 0 0 2 5 2 0 0 1 5 3 3 4 3 3 5 7
22 🇧🇪 Belgium 44 1 2 0 1 0 1 0 2 2 1 2 2 3 9 3 4 5 6
23 🇭🇺 Hungary 32 2 2 1 4 0 0 1 0 0 3 5 2 2 0 0 0 1 9
24 🇦🇷 Argentina 31 0 2 0 0 0 0 0 1 1 3 17 3 2 2 0 0 0 0
25 🇧🇬 Bulgaria 27 0 0 0 0 0 0 0 0 0 0 0 6 3 6 8 4 0 0
26 🇮🇪 Ireland 18 0 8 0 0 0 0 0 0 0 0 0 0 1 2 2 1 4 0
27 🇮🇩 Indonesia 17 0 0 0 2 0 0 1 0 1 4 1 2 1 1 1 0 3 0
28 🇯🇵 Japan 16 0 0 0 0 0 0 0 0 0 0 1 0 0 5 0 4 6 0
29 🇧🇷 Brazil 14 0 1 1 0 0 1 0 3 1 1 1 0 0 1 1 0 0 3
30 🇮🇳 India 12 0 1 0 0 0 0 0 0 0 0 0 0 2 1 0 8 0 0
31 🇨🇳 China 12 0 0 0 2 2 0 0 0 0 0 1 0 0 1 1 5 0 0
32 🇽🇮 international waters 10 1 3 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 2
33 🇸🇮 Slovenia 10 0 1 0 0 0 0 0 0 0 1 0 1 0 2 1 1 1 2
34 🇲🇽 Mexico 9 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 4 1
35 🇸🇰 Slovakia 8 0 0 0 0 0 0 0 0 0 1 4 0 0 0 0 2 0 1
36 🇺🇦 Ukraine 7 0 0 0 0 5 1 0 0 0 0 0 0 0 0 0 0 0 1
37 🇭🇷 Croatia 7 0 0 1 0 0 0 0 0 0 0 3 2 0 1 0 0 0 0
38 🇬🇷 Greece 7 0 0 0 0 0 1 0 0 0 1 1 2 0 2 0 0 0 0
39 🇿🇦 South Africa 6 0 0 0 0 0 0 0 2 0 0 0 0 0 1 1 0 2 0
40 🇵🇹 Portugal 6 1 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0
41 🇹🇷 Turkey 5 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 3 0
42 🇳🇵 Nepal 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 3 0 0
43 🇲🇾 Malaysia 4 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 1 0 0
44 🇱🇻 Latvia 4 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0
45 🇹🇭 Thailand 3 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0
46 🇷🇴 Romania 3 0 0 0 0 0 0 0 0 0 0 2 0 0 1 0 0 0 0
47 🇵🇭 Philippines 3 0 0 0 0 0 0 0 0 1 0 0 2 0 0 0 0 0 0
48 🇱🇺 Luxembourg 3 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1
49 🇱🇹 Lithuania 3 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
50 🇰🇷 South Korea 3 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0
51 🇪🇪 Estonia 3 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0
52 🇨🇾 Cyprus 3 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0
53 🇨🇷 Costa Rica 3 0 0 0 0 1 2 0 0 0 0 0 0 0 0 0 0 0 0
54 🇨🇱 Chile 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2
55 🇺🇿 Uzbekistan 2 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
56 🇲🇹 Malta 2 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0
57 🇯🇪 Jersey 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
58 🇮🇸 Iceland 2 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0
59 🇦🇶 Antarctica 2 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
60 🇻🇳 Vietnam 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
61 🇺🇾 Uruguay 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
62 🇹🇿 Tanzania 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
63 🇹🇼 Taiwan 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
64 🇹🇹 Trinidad and Tobago 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
65 🇹🇳 Tunisia 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
66 🇹🇯 Tajikistan 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
67 🇸🇲 San Marino 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
68 🇸🇯 Svalbard and Jan Mayen 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
69 🇷🇸 Serbia 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
70 🇵🇸 Palestine 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
71 🇵🇷 Puerto Rico 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
72 🇵🇪 Peru 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
73 🇳🇦 Namibia 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
74 🇲🇶 Martinique 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
75 🇲🇦 Morocco 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
76 🇱🇮 Liechtenstein 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
77 🇰🇭 Cambodia 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
78 🇰🇬 Kyrgyzstan 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
79 🇩🇴 Dominican Republic 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
80 🇨🇺 Cuba 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
81 🇦🇪 United Arab Emirates 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0

Coordinates reached

# Country Σ 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08
1 🇩🇪 Germany 4790 57 346 424 251 312 238 230 200 166 220 331 353 252 275 293 240 447 155
2 🇺🇸 United States of America 4303 40 135 169 144 110 145 95 99 125 177 228 278 436 438 267 427 588 402
3 🇬🇧 United Kingdom 1231 6 47 22 18 7 21 24 33 40 164 285 44 82 132 95 84 101 26
4 🇦🇺 Australia 807 23 91 87 82 44 24 15 11 20 24 26 22 59 53 35 44 69 78
5 🇫🇮 Finland 629 0 21 17 12 23 43 26 26 33 49 62 87 82 31 32 49 20 16
6 🇨🇦 Canada 415 0 14 10 6 6 11 4 12 9 5 7 14 20 29 47 83 76 62
7 🇳🇱 Netherlands 393 6 49 17 20 17 19 16 16 24 25 34 33 19 42 6 6 13 31
8 🇸🇪 Sweden 369 0 0 2 2 6 8 7 1 4 5 7 14 24 110 66 49 45 19
9 🇨🇭 Switzerland 282 10 29 29 5 5 16 1 2 3 10 12 13 52 36 26 14 14 5
10 🇫🇷 France 243 0 30 33 32 34 22 5 2 7 5 3 13 11 13 8 5 14 6
11 🇵🇱 Poland 179 1 4 32 5 8 8 4 6 7 5 22 15 26 11 6 14 3 2
12 🇮🇱 Israel 174 10 42 27 15 19 3 8 22 11 0 0 1 4 5 2 0 5 0
13 🇳🇴 Norway 143 3 13 27 33 2 2 0 0 0 0 3 4 0 15 8 19 1 13
14 🇳🇿 New Zealand 139 0 1 7 4 1 3 3 9 5 8 16 14 3 10 12 24 7 12
15 🇦🇹 Austria 124 1 4 2 5 3 1 1 2 5 8 20 46 14 0 3 4 3 2
16 🇪🇸 Spain 123 0 4 8 34 37 0 1 4 0 2 4 4 7 7 2 3 5 1
17 🇷🇺 Russia 86 0 0 2 1 12 4 1 0 1 3 2 5 34 19 1 1 0 0
18 🇨🇿 Czechia 55 6 3 1 0 0 0 0 1 0 0 12 2 2 7 5 5 7 4
19 🇮🇹 Italy 51 0 3 2 0 1 0 0 1 0 1 7 6 9 7 4 5 4 1
20 🇸🇬 Singapore 35 0 3 4 1 1 1 0 1 4 2 0 2 4 3 5 0 1 3
21 🇩🇰 Denmark 35 0 2 0 0 2 3 2 0 0 1 4 3 3 3 2 2 4 4
22 🇧🇪 Belgium 35 1 2 0 0 0 1 0 2 2 1 2 2 2 7 3 3 4 3
23 🇧🇬 Bulgaria 25 0 0 0 0 0 0 0 0 0 0 0 5 3 6 8 3 0 0
24 🇦🇷 Argentina 25 0 1 0 0 0 0 0 1 1 3 14 3 1 1 0 0 0 0
25 🇭🇺 Hungary 22 2 0 1 2 0 0 1 0 0 2 5 2 2 0 0 0 1 4
26 🇯🇵 Japan 14 0 0 0 0 0 0 0 0 0 0 1 0 0 4 0 3 6 0
27 🇮🇪 Ireland 13 0 5 0 0 0 0 0 0 0 0 0 0 0 1 2 1 4 0
28 🇮🇩 Indonesia 13 0 0 0 1 0 0 1 0 1 4 1 1 1 0 1 0 2 0
29 🇧🇷 Brazil 11 0 1 1 0 0 0 0 2 1 1 1 0 0 0 1 0 0 3
30 🇮🇳 India 10 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 8 0 0
31 🇸🇮 Slovenia 8 0 1 0 0 0 0 0 0 0 0 0 1 0 2 1 1 1 1
32 🇨🇳 China 8 0 0 0 2 1 0 0 0 0 0 0 0 0 1 0 4 0 0
33 🇸🇰 Slovakia 7 0 0 0 0 0 0 0 0 0 1 4 0 0 0 0 1 0 1
34 🇲🇽 Mexico 7 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1 3 1
35 🇺🇦 Ukraine 6 0 0 0 0 4 1 0 0 0 0 0 0 0 0 0 0 0 1
36 🇿🇦 South Africa 5 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 2 0
37 🇽🇮 international waters 5 1 2 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
38 🇵🇹 Portugal 5 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0
39 🇭🇷 Croatia 5 0 0 1 0 0 0 0 0 0 0 3 1 0 0 0 0 0 0
40 🇬🇷 Greece 5 0 0 0 0 0 1 0 0 0 0 1 1 0 2 0 0 0 0
41 🇱🇻 Latvia 4 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0
42 🇳🇵 Nepal 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 0 0
43 🇲🇾 Malaysia 3 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0
44 🇺🇿 Uzbekistan 2 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
45 🇹🇭 Thailand 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
46 🇷🇴 Romania 2 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0
47 🇵🇭 Philippines 2 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
48 🇲🇹 Malta 2 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0
49 🇱🇺 Luxembourg 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
50 🇱🇹 Lithuania 2 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
51 🇰🇷 South Korea 2 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
52 🇯🇪 Jersey 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
53 🇮🇸 Iceland 2 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0
54 🇪🇪 Estonia 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0
55 🇨🇾 Cyprus 2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0
56 🇨🇱 Chile 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
57 🇦🇶 Antarctica 2 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0
58 🇻🇳 Vietnam 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
59 🇹🇼 Taiwan 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
60 🇹🇹 Trinidad and Tobago 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
61 🇹🇷 Turkey 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
62 🇹🇳 Tunisia 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
63 🇹🇯 Tajikistan 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
64 🇸🇲 San Marino 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
65 🇸🇯 Svalbard and Jan Mayen 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
66 🇷🇸 Serbia 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
67 🇵🇸 Palestine 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
68 🇱🇮 Liechtenstein 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
69 🇰🇬 Kyrgyzstan 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
70 🇨🇷 Costa Rica 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
71 🇦🇪 United Arab Emirates 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0

See also

Source code

The following program generates this page:

#!/bin/bash

# Copyright 2021 Fippe
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

api="https://geohashing.site/api.php?format=json"
expandAPI="$api&action=expandtemplates&prop=wikitext&text"
categoryAPI="$api&action=query&list=categorymembers&cmprop=title&cmlimit=500&cmtitle=Category"
transcludedAPI="$api&action=query&prop=transcludedin&tiprop=title&tilimit=500&titles"

dir="/tmp/geohashingstats"
mkdir -p "$dir"
currentyear=$(date +%Y)

function gen {
    date -u +"The following table shows countries by their number of reached and total expeditions as of %Y-%m. __TOC__"
    echo "==Methodology and Limitations=="
    echo -e "For the purpose of this list, a country is defined as anything that has a [[wikipedia:ISO 3166-1|ISO 3166-1]] code.\n\nThis page is generated by looking where [[:Category:Location templates|location templates]] are transcluded, and at the [[:Category:Expeditions|expeditions category]] and the [[:Category:Coordinates reached|coordinates reached category]]. This page is only as good as those categories.\n\nCheck out the [[#Source code|program's source code]]."

    codes=$(curl -s "$categoryAPI:Location_templates" | jq -r ".query.categorymembers[].title" | grep "/" | cut -d "/" -f 2 | while read -r code
        do echo "$code~%7B%7Blocation/$code%7D%7D"

        echo dummy > "$dir/$code"
        ticontinue="0"
        while [ "$ticontinue" != "null" ]
            do curl -so "$dir/tmp" "$transcludedAPI=Template:Location/$code&tinamespace=0&ticontinue=$ticontinue"
            ticontinue=$(cat "$dir/tmp" | jq -r ".continue.ticontinue")
            cat "$dir/tmp" | jq -r ".query.pages[].transcludedin[].title" >> "$dir/$code" 2> /dev/null
        done
        rm "$dir/tmp"
    done | tr "\n" ";")

    curl -s "$expandAPI=$codes" | jq -r ".expandtemplates.wikitext" | tr ";~" "\n;" | grep -vx "" > "$dir/countries"

    for category in "Expeditions" "Coordinates_reached"
        do echo "==${category/_/ }=="

        echo -n > "$dir/$category"
        cmcontinue="0"
        while [ "$cmcontinue" != "null" ]
            do curl -so "$dir/tmp" "$categoryAPI:$category&cmcontinue=$cmcontinue"
            cmcontinue=$(cat "$dir/tmp" | jq -r ".continue.cmcontinue")
            cat "$dir/tmp" | jq -r ".query.categorymembers[].title" >> "$dir/$category"
        done
        rm "$dir/tmp"

        cat "$dir/countries" | while IFS=';' read -r code country
            do grep -cxf "$dir/$code" "$dir/$category" | tr "\n" " "
            echo "$code $country"
        done > "$dir/$category-countries"

        echo '{|class="wikitable sortable center zebra"'
        echo -n '!#!!Country!!Σ'

        for year in $(seq $currentyear -1 2008)
            do echo -n '!!'"${year:2:2}"
        done
        sort -nr "$dir/$category-countries" | grep -v "^0" | nl | while read -r rank total code country
            do echo -en "\n|-\n|$rank||{{flag|$code}} [[:Category:Meetup in $country|$country]]||$total" | sed -e "s/|the /|/"

            for year in $(seq $currentyear -1 2008)
                do cur=$(grep -xf "$dir/$code" "$dir/$category" | grep -c "^$year")
                echo -n "||$cur"
            done
        done
        echo -e "\n|}"
    done

    echo -e "==See also==\n*[[Most active Geohashers]]\n*[[Most active graticules]]\n*[[Maps and statistics]]\n==Source code=="
    echo "The following program generates this page:<pre"">$(cat "$0")</pre"">"
    echo "[[Category:Fun stuff]]"
}

gen | tee "$dir/mostactivecountries.wiki"