0

I would to either write a script or utilize Chrome extensions to automatically push links to my Android. I have Pushbullet installed which is great, but I have to manually push the links over using a keyboard shortcut. How might I go about automating this? Is there a way to push only certain URLs?

Thanks a lot!

5Y3WS
  • 49
  • 8
  • Are you pushing links from your chrome browser or from some other source? – Chris Pushbullet Apr 22 '15 at 22:00
  • @christopherhesse Well, the links originate from a scrapy/python script and automatically get inserted into the Chrome browser. Looking to basically extend my script for when I'm AFK. Chrome --> Phone is probably easiest, yeah? – 5Y3WS Apr 22 '15 at 22:01
  • If they're coming from a script, you can pretty easily call the pushbullet api to send a push to your phone: https://docs.pushbullet.com/#pushes – Chris Pushbullet Apr 22 '15 at 22:08
  • @christopherhesse Awesome man. I'm obviously a beginniner. This is way easier to build than I thought it would be. Thanks for the suggestion. You should answer and I'll mark it. – 5Y3WS Apr 22 '15 at 22:24

1 Answers1

2

If they're coming from a script, you can pretty easily call the pushbullet api to send a push to your phone: https://docs.pushbullet.com/#pushes

If you use curl on the command line, it would look something like this:

curl --header 'Authorization: Bearer <your_access_token_here>' -X POST https://api.pushbullet.com/v2/pushes \
    --header 'Content-Type: application/json' \
    --data-binary '{"type": "note", "title": "Note Title", "body": "Note Body"}'

If you're using python, you probably want to use the requests library, where it would look something like:

requests.post('https://api.pushbullet.com/v2/pushes',
    data=json.dumps({"type": "note", "title": "Note Title", "body": "Note Body"}), 
    headers={'Authorization': 'Bearer <access token>', 'Content-Type': 'application/json'})

You can find your access token on this page: https://www.pushbullet.com/account

Chris Pushbullet
  • 1,039
  • 9
  • 10