Created
November 2, 2024 05:13
-
-
Save EllieTheYeen/f517cd9ad4ec427abe6fa34dd8965e5a 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 | |
if [ ${#@} -gt 1 ]; then | |
TITLE="$1" | |
BODY="${@:2}" | |
else | |
TITLE="" | |
BODY="$@" | |
fi | |
token="$(cat ~/.pushtoken)" | |
curl \ | |
-X POST \ | |
--header "Access-Token: $token" \ | |
--header 'Content-Type: application/x-www-form-urlencoded' \ | |
--data 'type=note' \ | |
--data-urlencode "title=$TITLE" \ | |
--data-urlencode "body=$BODY" \ | |
'https://api.pushbullet.com/v2/pushes' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment