Skip to content

Instantly share code, notes, and snippets.

View Nocube's full-sized avatar

Nocube

View GitHub Profile
@Nocube
Nocube / pushme.py
Last active March 29, 2020 21:22 — forked from JagCesar/pushMe.sh
Push Me Python script
#! /usr/bin/python
import requests
# Send Message to Push Me App via HTTP POST Request.
# This mimics the Curl headers.
def PostAlert(secret_tok, msg):
url = 'https://pushmeapi.jagcesar.se'
data='title=' + msg + '&token=' + secret_tok
headers = {'Host': 'pushmeapi.jagcesar.se', 'User-Agent': 'curl/7.55.1', 'Accept': '*/*', \
'Content-Length': str(len(data)), 'content-type': 'application/x-www-form-urlencoded'}
r = requests.post(url, data, headers=headers)