Skip to content

Instantly share code, notes, and snippets.

@simonbs
Created September 29, 2019 19:03
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 simonbs/81408a4f2211aa3c3e1f358255791293 to your computer and use it in GitHub Desktop.
Save simonbs/81408a4f2211aa3c3e1f358255791293 to your computer and use it in GitHub Desktop.
Scriptable script that shows today's XKCD in Siri.
let url = "https://xkcd.com/info.0.json"
let req = new Request(url)
let json = await req.loadJSON()
let imgURL = json["img"]
alt = json["alt"]
req = new Request(imgURL)
let img = await req.loadImage()
QuickLook.present(img)
if (config.runsWithSiri) {
Speech.speak(alt)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment