Skip to content

Instantly share code, notes, and snippets.

@lynsei
Created April 25, 2022 00:04
Show Gist options
  • Save lynsei/2ad7206745a480fcb3f2591f7add85bf to your computer and use it in GitHub Desktop.
Save lynsei/2ad7206745a480fcb3f2591f7add85bf to your computer and use it in GitHub Desktop.
[is slack down?] #javascript #node code for checking slack status
// Checks if Slack is down by examining their status page. Works perfectly with Siri.
let url = "https://status.slack.com"
let r = new Request(url)
let body = await r.loadString()
Safari.openInApp(url)
if (config.runsWithSiri) {
let needles = [
"up and running",
"smooth sailing"
]
let foundNeedles = needles.filter(n => {
return body.includes(n)
})
if (foundNeedles.length > 0) {
Speech.speak("No")
} else {
Speech.speak("Yes")
}
}
// It is good practice to call Script.complete() at the end of a script, especially when the script is used with Siri or in the Shortcuts app. This lets Scriptable report the results faster. Please see the documentation for details.
Script.complete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment