Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Created February 7, 2021 12:05
Show Gist options
  • Save ruanbekker/0a413e9a2618d7853b9efd3e5b053ade to your computer and use it in GitHub Desktop.
Save ruanbekker/0a413e9a2618d7853b9efd3e5b053ade to your computer and use it in GitHub Desktop.
Pushover Notifiers Examples

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment