Skip to content

Instantly share code, notes, and snippets.

@robertgc
Forked from cameri/pb.sh
Created September 4, 2013 19:55
Show Gist options
  • Save robertgc/6442035 to your computer and use it in GitHub Desktop.
Save robertgc/6442035 to your computer and use it in GitHub Desktop.
#!/bin/bash
PUSH_URL="https://www.pushbullet.com/api/pushes"
function pb_pushnote {
/usr/bin/curl "${PUSH_URL}" \
-u "$1:" \
-d "device_id=$2" \
-d "type=note" \
-d "title=$3" \
-d "body=$4" \
-X POST
}
function pb_pushaddress {
/usr/bin/curl "${PUSH_URL}" \
-u "$1:" \
-d "device_id=$2" \
-d "type=address" \
-d "name=$3" \
-d "address=$4" \
-X POST
}
function pb_pushlist {
/usr/bin/curl "${PUSH_URL}" \
-u "$1:" \
-d "device_id=$2" \
-d "type=list" \
-d "title=$3" \
-d "items=$4" \
-X POST
}
function pb_pushfile {
# Not implemented
return 0
/usr/bin/curl "${PUSH_URL}" \
-u "$1:" \
-d "device_id=$2" \
-d "type=file" \
-d "file=$3" \
-X POST
}
function pb_pushlink {
/usr/bin/curl "${PUSH_URL}" \
-u "$1:" \
-d "device_id=$2" \
-d "type=link" \
-d "title=$3" \
-d "url=$4" \
-X POST
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment