Created
December 5, 2017 15:50
-
-
Save iacchus/10cf82251967a5435c45cebfb04531b4 to your computer and use it in GitHub Desktop.
Simple Python Pushover Script using Requests to Send Message
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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