covid-19
1 QQ
covid-19/  reload-data/  qq
qq/  data
qq/  data/  china-total
qq/  data/  china-add
qq/  data/  all-provinces
qq/  get-region
qq/  get-num
qq/  get-num*
qq/  sort+  filter-by
2 Sina
covid-19/  reload-data/  sina
sina/  data
sina/  data/  list
sina/  data/  otherlist
sina/  contries/  sort+  filter-by
8.16

covid-19πŸ”—β„Ή

Yanying Wang <yanyingwang1@gmail.com>

Racket wrapper of QQ/Sina’s COVID-19 API

    1 QQ

    2 Sina

 (require covid-19) package: covid-19

1 QQπŸ”—β„Ή

 (require covid-19/qq) package: covid-19

parameter

(covid-19/reload-data/qq) β†’ boolean?

(covid-19/reload-data/qq v) β†’ void?
  v : boolean?
 = #t
Whether rerequest QQ’s COVID-19 API and reflush cached data or not, which data is used for all the following procedures.

procedure

(qq/data) β†’ hash-eq?

procedure

(qq/data/china-total) β†’ hash-eq?

procedure

(qq/data/china-add) β†’ hash-eq?

procedure

(qq/data/all-provinces) β†’ list?

Returns corresponding requested data.

procedure

(qq/get-region province-name city-name) β†’ hash-eq?

  province-name : (or/c string? symbol?)
  city-name : (or/c string? symbol?)
Returns data of a specified province-name of China or data of its specified city-name if provided.

Examples:
> (qq/get-region '河南)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

> (qq/get-region '河南 'ιƒ‘ε·ž)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

procedure

(qq/get-num node-data [type1 type2]) β†’ number?

  node-data : (hash-eq?)
  type1 : (or/c 'confirm 'dead) = 'confirm
  type2 : (or/c 'today 'total) = 'today
Returns the number of type1 in type2 of the node-data, which node-data is the result of qq/get-province.

Example:
> (qq/get-num (qq/get-region '河南) 'confirm 'total)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

procedure

(qq/get-num* province-name    
  [type1    
  type2    
  #:city city-name]) β†’ number?
  province-name : symbol?
  type1 : (or/c 'confirm 'dead) = 'confirm
  type2 : (or/c 'today 'total) = 'today
  city-name : string? = #f
Returns a number of type1 in type2 of a specified city-name of province-name.

Examples:
> (qq/get-num* '河南)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

> (qq/get-num* '河南 'confirm 'total)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

> (qq/get-num* '河南 'confirm 'total #:city 'ιƒ‘ε·ž)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

> (qq/get-num* '上桷 'confirm 'total #:city '徐汇)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

procedure

(qq/sort+filter-by type1 type2) β†’ list?

  type1 : (or/c 'confirm 'dead)
  type2 : (or/c 'today 'total)
Sorting and filting qq/data/all-provinces by type1 and type2.

Example:
> (qq/sort+filter-by 'confirm 'total)

tcp-connect: host not found

  hostname: api.inews.qq.com

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3

2 SinaπŸ”—β„Ή

 (require covid-19/sina) package: covid-19

parameter

(covid-19/reload-data/sina) β†’ boolean?

(covid-19/reload-data/sina v) β†’ void?
  v : boolean?
 = #t
Whether rerequest Sina COVID-19 API and reflush cached data or not, which data is used for all the following procedures.

procedure

(sina/data) β†’ hash-eq?

procedure

(sina/data/list) β†’ list?

procedure

(sina/data/otherlist) β†’ list?

Returns corresponding requested data.

procedure

(sina/contries/sort+filter-by type) β†’ number?

  type : (or/c 'conNum 'conadd 'deathNum 'deathadd)
Sorting and filting sina/data/otherlist by type.

Example:
> (sina/contries/sort+filter-by 'conNum)

tcp-connect: host not found

  hostname: interface.sina.cn

  port number: 443

  system error: Temporary failure in name resolution;

gai_err=-3