croc

Is Discord Down?

Oct 29th, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // To be used with Scriptable for iOS
  2. // Learn more at https://scriptable.app
  3.  
  4. // Checks if Discord is down by examining
  5. // their status page. This script works
  6. // well when when triggered from a Siri
  7. // Shortcut. You can configure a Siri
  8. // Shortcut from the script settings.
  9. let url = "https://status.discordapp.com"
  10. let r = new Request(url)
  11. let body = await r.loadString()
  12. Safari.openInApp(url)
  13. // Use the global variable "config" to check
  14. // if the app is run from Siri before we
  15. // speak a text.
  16. if (config.runsWithSiri) {
  17.   let needle = "All Systems Operational"
  18.   if (body.includes(needle)) {
  19.     Speech.speak("No")
  20.   } else {
  21.     Speech.speak("Yes")
  22.   }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment