Skip to content

Instantly share code, notes, and snippets.

@jsanz
Created June 4, 2021 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsanz/bccf78e9a0be963158e3abc58b667bd7 to your computer and use it in GitHub Desktop.
Save jsanz/bccf78e9a0be963158e3abc58b667bd7 to your computer and use it in GitHub Desktop.
[SPARQL] Country websites ping

Ping sites

This is a CSV with country official websites from all the world, and a simple script that randomly access to five of them every five seconds. The objective of this is to hit as many different country IP's as possible.

The CSV is obtained from this SPARQL query to Wikidata:

SELECT 
  ?idLabel 
  (SAMPLE(?website) as ?web) 
WHERE {
  ?id wdt:P31/wdt:P279* wd:Q6256;
      wdt:P856 ?website.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
} GROUP BY ?id ?idLabel
#!/usr/bin/env bash
while true; do
cat website.csv | csvcut -c 2 | tail -n +2 | shuf -n 5 | xargs curl -sI
sleep 5
done
idLabel web
Canada https://www.canada.ca
Japan https://www.japan.go.jp/index.html
Norway http://www.noreg.no
Ireland http://www.gov.ie/
Hungary https://www.kormany.hu/en
United States of America https://www.usa.gov/
Finland https://finland.fi/
Sweden http://www.sweden.se/
Denmark http://www.denmark.dk/
Italy http://www.italia.it/
Switzerland https://www.admin.ch/gov/de/start.html
Austria https://www.austria.info/us
Greece https://government.gov.gr/
Turkey https://www.turkiye.gov.tr/
Portugal https://www.portugal.gov.pt/en/gc21
Netherlands https://www.government.nl/
Uruguay http://portal.gub.uy
Egypt http://www.egypt.travel/
Mexico https://www.visitmexico.com/en/
Kenya http://www.president.go.ke
Ghana https://www.ghana.gov.gh/
France http://www.france.fr/
People's Republic of China http://english.www.gov.cn/
Brazil https://www.gov.br
Germany https://www.deutschland.de/en
Belarus https://www.belarus.by/
Latvia https://www.latvia.eu/
Czech Republic http://www.czech.cz/
Slovakia https://www.slovakia.com/
Romania http://www.guv.ro/
Bulgaria http://www.government.bg/
Albania https://www.kryeministria.al/en/
Croatia https://vlada.gov.hr/en
Andorra https://www.govern.ad/
Cyprus http://www.cyprus.gov.cy/
Kazakhstan http://www.government.kz/
Malta http://www.gov.mt/
Montenegro http://www.gov.me/en/homepage?alphabet=lat
Cuba http://www.cuba.com/
Barbados http://www.gov.bb/
Indonesia https://indonesia.go.id
South Africa http://www.gov.za
Uzbekistan https://www.gov.uz/en
Chile https://www.thisischile.cl/?lang=en
Singapore https://www.gov.sg/
Liechtenstein https://tourismus.li/en/
Bahrain https://www.bahrain.bh
Australia https://www.australia.com/
Argentina https://www.argentina.gob.ar/
Peru https://www.peru.travel/en-us/
North Korea https://www.korea-dpr.com/
Cambodia https://www.tourismcambodia.com/
East Timor http://timor-leste.gov.tl/?lang=en
New Zealand https://www.govt.nz/
India http://india.gov.in/
Tuvalu http://www.tuvaluislands.com/
Samoa http://www.samoagovt.ws/
Solomon Islands https://www.visitsolomons.com.sb/
Vanuatu http://www.governmentofvanuatu.gov.vu/
Papua New Guinea https://papuanewguinea.travel/
Palau http://www.palaugov.org/
Federated States of Micronesia http://www.fsmgov.org/
Kiribati https://www.kiribati.gov.ki
Mongolia https://zasag.mn/en/
Fiji https://www.fiji.gov.fj/Home
Venezuela http://mppre.gob.ve/
Paraguay https://www.paraguay.gov.py/
Guyana http://www.parliament.gov.gy/
Ecuador http://www.culturaypatrimonio.gob.ec/
Colombia http://www.colombia.travel/en
Trinidad and Tobago http://www.gov.tt/
Saint Vincent and the Grenadines http://www.gov.vc
Saint Lucia http://www.stlucia.org
Saint Kitts and Nevis https://www.gov.kn/
Jamaica https://www.gov.jm/
Grenada https://www.gov.gd/
Guatemala https://www.guatemala.gob.gt/
The Bahamas https://www.bahamas.com/
Antigua and Barbuda http://www.ab.gov.ag
Honduras https://www.honduras.travel/en/
Tonga http://www.mic.gov.to/
Kyrgyzstan http://www.discoverkyrgyzstan.org/
Laos https://www.tourismlaos.org/
Maldives https://visitmaldives.com/
Malaysia https://www.malaysia.travel/en/us
Myanmar https://www.myanmar.gov.mm/en/web/guest
Nepal https://nepal.gov.np
Oman https://www.oman.om/wps/portal/index/!ut/p/a1/hY7NCsIwEISfxUOPdhcjxXoLiGK1eFC03YukGNNgTUoaLb69tUfxZ24zfDMMEGRARty1El5bI6qXp-jIcIG4iZfpapdyHLH9PInXEZvNxh2QdwB-Ecd__QNQj_xYSIBUZYv-Tc5NwSYKyMmzdNKFN9fFpfd1Mw0wQGnCVl90LU9ahNapAD-VStt4yN5Z2EoD9TXDIRUP1vLBEwuKhyo!/dl5/d5/L0lKQSEvUUt3TS80RUkhL2Vu/
Pakistan http://www.pakistan.gov.pk
Qatar http://www.diwan.gov.qa/
Saudi Arabia http://www.saudi.gov.sa
Sri Lanka http://www.gov.lk/
Syria http://www.egov.sy/
Taiwan https://www.gov.tw
Thailand http://www.thaigov.go.th/
Turkmenistan http://www.turkmenistan.gov.tm/
United Arab Emirates https://www.government.ae/en
Vietnam http://www.vietnam.gov.vn/portal/page/portal/English
South Korea http://www.korea.net/
Bangladesh http://www.bangladesh.gov.bd
Mali http://www.primature.gov.ml
Angola http://www.governo.gov.ao/
Bhutan http://www.bhutan.gov.bt
Brunei https://www.gov.bn/bm/Home.aspx
Tanzania https://www.tanzania.go.tz/
Philippines http://www.gov.ph/
Togo https://www.republicoftogo.com
Tunisia http://www.tunisie.gov.tn/
Zambia http://www.statehouse.gov.zm
Zimbabwe http://www.parlzim.gov.zw/
South Sudan http://www.goss-online.org/
Benin https://www.gouv.bj/
Botswana http://www.gov.bw
Burkina Faso https://www.gouvernement.gov.bf/accueil
Burundi http://www.burundi.gov.bi/#
Djibouti https://www.presidence.dj/
Eritrea http://www.shabait.com/index.php
The Gambia http://statehouse.gm/
Guinea http://www.presidence.gov.gn/
Guinea-Bissau https://www.guinebissaurepublic.com
Ivory Coast http://www.gouv.ci
Cameroon https://www.prc.cm/en/
Cape Verde http://www.governo.cv
Lesotho https://www.gov.ls/
Liberia https://visitliberia.net/
Malawi http://www.malawi.gov.mw/
Mauritius http://mauritius.net/
Morocco http://www.maroc.ma/en
Mozambique http://www.portaldogoverno.gov.mz/
Namibia https://gov.na/
Niger http://www.presidence.ne
Uganda http://www.statehouse.go.ug/
Rwanda http://www.gov.rw/
São Tomé and Príncipe http://www.saotome.st/
Senegal http://www.gouv.sn
Seychelles http://www.egov.sc/
Sierra Leone https://statehouse.gov.sl/
Somalia https://www.somalia.gov.so
Sudan http://www.sudan.gov.sd/index.php/en
Galicia https://www.xunta.gal/
American Samoa http://www.americansamoa.gov/
Northern Mariana Islands http://gov.mp/
Aruba http://www.aruba.com/
Cook Islands http://www.ck/govt.htm
Niue http://www.gov.nu/wb/
Somaliland https://www.govsomaliland.org/
Gagauzia http://www.gagauzia.md/index.php?l=en
Transnistria http://gov-pmr.org/
Kingdom of Africa https://africagov.org
Dominica http://www.dominica.gov.dm/
Dominican Republic https://www.dominicanrepublic.com/
Haiti http://primature.gouv.ht/
Eswatini http://www.gov.sz/
Russia http://gov.ru/
Iceland http://www.iceland.is/
Estonia https://www.eesti.ee/en/
Ukraine http://www.kmu.gov.ua/en
Slovenia http://www.gov.si/
Moldova http://www.moldova.md/
North Macedonia https://www.vlada.mk/
Bosnia and Herzegovina http://www.fbihvlada.gov.ba
Azerbaijan http://mfa.gov.az/en
Monaco http://www.visitmonaco.com/en
Vatican City http://www.vaticanstate.va/content/vaticanstate/de.html
Belize http://www.belize.gov.bz/
Armenia http://www.gov.am/en/
Serbia http://www.srbija.gov.rs/
Suriname http://www.gov.sr/
Costa Rica https://www.visitcostarica.com/en
Israel https://www.gov.il/
Panama https://visitpanama.com/?lang=en
Yemen http://www.yemen.gov.ye/
Jordan https://jordan.gov.jo/wps/portal/%5c?lang=en#/
Nicaragua https://www.visitnicaragua.us/
Kuwait https://www.e.gov.kw/
Gabon http://www.gouvernement.ga/
Navajo Nation http://www.navajo-nsn.gov/
El Salvador https://elsalvador.travel/en/
Iran http://www.president.ir/en
Iraq https://gds.gov.iq/
Asgardia https://asgardia.space/
Spain http://www.spain.info/
Belgium https://www.belgium.be/de
Luxembourg http://luxembourg.public.lu/en/
Lithuania https://lietuva.lt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment