Created
April 10, 2021 11:25
-
-
Save bessarabov/840045383ab4ab0bd5a1eb266c5b1219 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -s 'https://www.artlebedev.ru/country-list/tab/' > countries.tsv; curl -s 'https://analytics.home-assistant.io/data.json' |perl -MJSON::PP -MData::Dumper -nalE '$c .= $_; }{ $d = decode_json $c; foreach (keys %{$d}) { if ($d->{$_}->{countries}) { foreach $id (keys %{$d->{$_}->{countries}}) { say $id, " ", $d->{$_}->{countries}->{$id}} } }'|sort -k2 -nr|head -30|perl -C -nalE '$tsv = `cat countries.tsv`; @lines = split/\n/, $tsv; foreach (@lines) { @f = split /\t/,$_; $id2name{$f[3]} = $f[0] }; $i++; say sprintf "%2s %2s %-25s %10s", $i, $F[0], $id2name{$F[0]}, $F[1]' | |
1 US Соединенные Штаты 1613 | |
2 NL Нидерланды 974 | |
3 DE Германия 790 | |
4 GB Соединенное Королевство 655 | |
5 PL Польша 490 | |
6 IT Италия 414 | |
7 SE Швеция 365 | |
8 FR Франция 316 | |
9 AU Австралия 303 | |
10 DK Дания 277 | |
11 CA Канада 274 | |
12 BE Бельгия 204 | |
13 NO Норвегия 201 | |
14 ES Испания 201 | |
15 RU Россия 166 | |
16 PT Португалия 144 | |
17 BR Бразилия 114 | |
18 CH Швейцария 110 | |
19 FI Финляндия 100 | |
20 CZ Чешская Республика 97 | |
21 ZA Южная Африка 92 | |
22 RO Румыния 91 | |
23 AT Австрия 91 | |
24 NZ Новая Зеландия 86 | |
25 HU Венгрия 79 | |
26 UA Украина 71 | |
27 CN Китай 64 | |
28 IL Израиль 49 | |
29 IE Ирландия 46 | |
30 SK Словакия 44 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment