Created
February 4, 2015 20:09
-
-
Save AnotherKamila/eebdafbbde76014bfd69 to your computer and use it in GitHub Desktop.
Quick script to push a link via Pushbullet
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
#!/bin/bash | |
# Pushes a link through Pushbullet. Set $1 to title and $2 to the link. | |
ACCESS_TOKEN=<Your access token here> | |
CHANNEL_TAG=<Your channel tag here> | |
PUSH_METHOD=POST | |
PUSH_URL=https://api.pushbullet.com/v2/pushes | |
if [ $# != 2 ]; then echo "Usage: $0 title href"; exit 1; fi | |
TITLE="$1" | |
HREF="$2" | |
curl -u $ACCESS_TOKEN: -X $PUSH_METHOD $PUSH_URL \ | |
--header 'Content-Type: application/json' \ | |
--data-binary @- <<-EOF | |
{ | |
"channel_tag": "$CHANNEL_TAG", | |
"type" : "link", | |
"title": "$TITLE", | |
"url" : "$HREF", | |
"body" : "" | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment