Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # Script to automatically post to thundermessage.com using LND / lncli
  3. # Save to a file like script.sh
  4. # chmod a+x script.sh
  5. # ./script.sh "Your awesome message."
  6. # Donations accepted at: 1H5ZJgZFRSkcxJs4iTaf99Q5sjhH8hCcgp
  7. SATOSHIS="37"
  8. MESSAGE="$1"
  9. DATA='{"body":"'$MESSAGE'","votes":'$SATOSHIS'}'
  10. CONTENT_TYPE='Content-Type: application/json'
  11. RESPONSE=`curl --header "$CONTENT_TYPE" --request POST --data "$DATA" https://thundermessage.com/api/submit/post`
  12. INV_SATS=`echo $RESPONSE | jq '.satoshis'`
  13. BOLT=`echo $RESPONSE | jq '.bolt11'`
  14. temp="${BOLT%\"}"
  15. temp="${temp#\"}"
  16. echo $temp
  17. [ $INV_SATS == $SATOSHIS ] && lncli payinvoice $temp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement