Last active
August 29, 2015 14:02
-
-
Save 0asa/6e1805a500857b6ef996 to your computer and use it in GitHub Desktop.
Pushbullet notification
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
import requests | |
API_KEY = 'API_KEY' | |
IDEN = 'DEVICE_ID' | |
# get the list of available devices | |
resp = requests.get('https://api.pushbullet.com/v2/devices',auth=(API_KEY,'')) | |
print resp.json() | |
data = { | |
'type':'note', | |
'title':'Now', | |
'body':'I can send push notifications to my phone from a Python script (or whatever)', | |
'device_iden' : IDEN | |
} | |
# send a push notification | |
resp = requests.post('https://api.pushbullet.com/api/pushes',data=data, auth=(API_KEY,'')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hurry up, go get more informations here...