Skip to content

Instantly share code, notes, and snippets.

@Snigelson
Created March 2, 2016 11:34
Show Gist options
  • Save Snigelson/9334e480a8cf38b6707b to your computer and use it in GitHub Desktop.
Save Snigelson/9334e480a8cf38b6707b to your computer and use it in GitHub Desktop.
#!/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
@Snigelson
Copy link
Author

Missing: Encoding of receiver and payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment