Skip to content

Instantly share code, notes, and snippets.

@rsalzer
rsalzer / Coronavirus.js
Last active May 25, 2021 16:12 — forked from planecore/Coronavirus.js
Coronavirus Scriptable Widget
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
const canton = "ZH"
const url = `https://covid19-rest.herokuapp.com/api/openzh/v1/country/CH/area/${canton}`
const req = new Request(url)
const res = await req.loadJSON()
const today = res.records[res.records.length-1]
const yesterday = res.records[res.records.length-2]
const twodaysago = res.records[res.records.length-3]