Search code examples
androidgoogle-chromepushbullet

What's the best way to automatically push a link to my phone?


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!


Solution

  • 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