Advertisement
Guest User

Untitled

a guest
Mar 4th, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. property APPAPI : "XXXXXXXXXXXXXXXXXX"
  2. property USERAPI : "YYYYYYYYY"
  3. on run {}
  4.     my pushapi("Reboot on Plex", "date", 0)
  5. end run
  6. on pushapi(the_title, message_to_send, priority)
  7.     if the_title is "date" then
  8.         set the_title to ((current date) as text)
  9.     end if
  10.     if message_to_send is "date" then
  11.         set message_to_send to ((current date) as text)
  12.     end if
  13.     set result to (do shell script "curl -s \\
  14.  -F \"token=" & APPAPI & "\" \\
  15.  -F \"user=" & USERAPI & "\" \\
  16.  -F \"title=" & the_title & "\" \\
  17.  -F \"message=" & message_to_send & "\" \\
  18.  -F \"priority=" & priority & "\" \\
  19.  -F \"expire=3600\" \\
  20.  -F \"retry=60\" \\
  21.  https://api.pushover.net/1/messages")
  22.     return true
  23. end pushapI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement