Last active
April 18, 2016 15:59
-
-
Save dschep/b9c5b5529381d1737fc3 to your computer and use it in GitHub Desktop.
Desktop notifications from Github using ntfy
This file contains 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 | |
import json | |
import time | |
import requests | |
from ntfy.backends.default import notify | |
USER = 'YOUR USERNAME' | |
TOKEN = 'YOUR TOKEN' | |
API_URL = 'https://api.github.com' | |
while time.sleep(30) or True: | |
resp = requests.get(API_URL + '/notifications', auth=(USER, TOKEN), | |
verify=False) | |
for notification in resp.json(): | |
notify( | |
notification['repository']['full_name'], | |
notification['subject']['title'], | |
icon='/usr/share/icons/Numix-Circle/48x48/apps/gitg.svg', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment