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