mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-15 05:45:05 -05:00
23 lines
640 B
Groovy
23 lines
640 B
Groovy
/****************************************************************************
|
|
* Pushover
|
|
* https://pushover.net
|
|
****************************************************************************/
|
|
def Pushover(user, token = 'wcckDz3oygHSU2SdIptvnHxJ92SQKK') {
|
|
new PushoverClient(user:user, token:token)
|
|
}
|
|
|
|
class PushoverClient {
|
|
def user
|
|
def token
|
|
|
|
def endpoint = new URL('https://api.pushover.net/1/messages.xml')
|
|
|
|
def send = { text, parameters = [:] ->
|
|
// inject default post parameters
|
|
parameters << [token:token, user:user, message:text as String]
|
|
|
|
// post and process response
|
|
endpoint.post(parameters).text.xml
|
|
}
|
|
}
|