10

从命令行追踪新冠肺炎全球疫情数据

 3 years ago
source link: https://www.lujun9972.win/blog/2021/08/07/%E4%BB%8E%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%BF%BD%E8%B8%AA%E6%96%B0%E5%86%A0%E8%82%BA%E7%82%8E%E5%85%A8%E7%90%83%E7%96%AB%E6%83%85%E6%95%B0%E6%8D%AE/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

从命令行追踪新冠肺炎全球疫情数据

今天发现一个好牛逼的网站,可以让我们通过命令行查看新冠肺炎全球疫情数据

  1. 查看指定国家的今日疫情数据

通过访问 `https://corona-stats.online/国家名称` 可以获得指定国家的今日疫情数据,例如下面命令查看中国的当前疫情数据:

curl https://corona-stats.online/china

corona19-01.png

  1. 获取新冠肺炎全球TOP排行榜数据

通过访问 `https://corona-stats.online?top=N` 可以获得感染人数前N的国家今日疫情数据,例如下面命令查看感染人数前5的国家及其疫情数据:

curl https://corona-stats.online?top=5

corona19-02.png

  1. 指定返回 JSON 格式的数据

通过在访问URL后加上 ?format=json 可以获取 JSON 格式的数据,例如下面命令获取中国今日新冠感染人数的JSON数据集:

curl "https://corona-stats.online/china?format=json" |jq

输出结果为

{
  "data": [
    {
      "updated": 1628329931927,
      "country": "China",
      "countryInfo": {
        "_id": 156,
        "iso2": "CN",
        "iso3": "CHN",
        "lat": 35,
        "long": 105,
        "flag": "https://disease.sh/assets/img/flags/cn.png"
      },
      "cases": 93605,
      "todayCases": 107,
      "deaths": 4636,
      "todayDeaths": 0,
      "recovered": 87525,
      "todayRecovered": 33,
      "active": 1444,
      "critical": 39,
      "casesPerOneMillion": 65,
      "deathsPerOneMillion": 3,
      "tests": 160000000,
      "testsPerOneMillion": 111163,
      "population": 1439323776,
      "continent": "Asia",
      "oneCasePerPeople": 15377,
      "oneDeathPerPeople": 310467,
      "oneTestPerPeople": 9,
      "activePerOneMillion": 1,
      "recoveredPerOneMillion": 60.81,
      "criticalPerOneMillion": 0.03,
      "confirmed": 93605,
      "countryCode": "CN"
    }
  ],
  "worldStats": {
    "country": "World",
    "countryCode": "World",
    "cases": 202490517,
    "todayCases": 130727,
    "deaths": 4292020,
    "todayDeaths": 2305,
    "recovered": 180258478,
    "active": 17940019,
    "critical": 95654,
    "casesPerOneMillion": "25980.31",
    "confirmed": 202490517
  }
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK