omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Push notifications using pushbullet

    Pythonista
    1
    1
    1845
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Moe
      Moe last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB Forums | Contributors