Created
April 25, 2022 00:04
-
-
Save lynsei/2ad7206745a480fcb3f2591f7add85bf to your computer and use it in GitHub Desktop.
[is slack down?] #javascript #node code for checking slack status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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