In BASH:
# usage: ./pushover-notify home-pc "homepc notification"
#!/bin/bash
APP_TOKEN='x'
USER_TOKEN='x'
TITLE="$1"
MESSAGE="$2"
curl 'https://api.pushover.net/1/messages.json' -X POST -d "token=$APP_TOKEN&user=$USER_TOKEN&message=\"$MESSAGE\"&title=$TITLE"
In Python:
import requests
r = requests.post("https://api.pushover.net/1/messages.json", data = {
"token": "x",
"user": "x",
"message": "hello world"
}
)
print(r.text)