Skip to content

Instantly share code, notes, and snippets.

@iacchus
Created December 5, 2017 15:50
Show Gist options
  • Save iacchus/10cf82251967a5435c45cebfb04531b4 to your computer and use it in GitHub Desktop.
Save iacchus/10cf82251967a5435c45cebfb04531b4 to your computer and use it in GitHub Desktop.
Simple Python Pushover Script using Requests to Send Message
#!/usr/bin/env python3
# 1. Just fill 'app token' and 'user key' below,
# 2. make the script executable: chmod +x simple-python-pushover.py
# 3. run in command line.
# Dependencias are python3 and `requests` lib
APP_TOKEN = ''
USER_KEY = ''
import requests as r
API_ENDPOINT = "https://api.pushover.net/1/messages.json"
PAYLOAD = {
'token': APP_TOKEN,
'user': USER_KEY,
'message': 'hello, world!'
}
a = r.post(API_ENDPOINT, PAYLOAD)
# uncomment to deug
# print(a.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment