Created
March 2, 2016 11:34
-
-
Save Snigelson/9334e480a8cf38b6707b 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/sh | |
# Sends an SMS. Usage: | |
# sms <number> | |
# Message is read from stdin. | |
# | |
# Access token is read from ~/pushbullet.token and device id from ~/pushbullet.device. | |
# I would recommend keeping these files chmod 400. | |
device=`cat ~/pushbullet.device` | |
push='{"type": "push", "push":{"conversation_iden": "'$1'", "message": "'`cat /dev/stdin`'", "package_name": "com.pushbullet.android", "source_user_iden": "'$device'","target_device_iden": "'$device'","type": "messaging_extension_reply"}}' | |
curl --header 'Access-Token: '`cat ~/pushbullet.token` \ | |
--header 'Content-Type: application/json' \ | |
--data-binary "$push" \ | |
--request POST \ | |
https://api.pushbullet.com/v2/ephemerals | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Missing: Encoding of receiver and payload.