Moe
Feb 06, 2015 - 15:41
I wrote this little script to use push notifications using Pythonista :)
import requests
#You need a pushbullet.com account + the pushbullet app.
#Download the app and create your account from there.
#Now get a token at https://www.pushbullet.com/account and insert it down below.
token = 'TOKEN' #account token
url = 'https://api.pushbullet.com/v2/pushes' #the url for pushes
def push(title,msg='',link=''): #function to send a push notification
dict = {'type':'note',
'title':title,
'body':msg,
'url':link}
if link != '':
dict['type'] = 'link'
r = requests.request('POST', url, auth=(token,''), data=dict) #perform request with token and data
This might be useful, if you want to send a message from one device to another. I am currently trying to add to specify a registered device to which the message should be send to.
One downside is that if you send a link and tap on the notification, you will be send to the pushbullet app and have to click on a button there, to go to the link destination.