Skip to content

Instantly share code, notes, and snippets.

@cameri
Created September 4, 2013 18:38
Show Gist options
  • Save cameri/6440993 to your computer and use it in GitHub Desktop.
Save cameri/6440993 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