scrobble-me.sh 562 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. HOME=/home/themusicgod1
  3. INSTANCE=shitposter.world
  4. #echo "
  5. TITLE=`cat /tmp/scrobblescript-title`;
  6. #echo "ARTIST:"
  7. ARTIST=`cat /tmp/scrobblescript-artist`;
  8. #echo "ALBUM:"
  9. ALBUM=`cat /tmp/scrobblescript-album`;
  10. echo "TOKEN:"
  11. TOKEN=`cat $HOME/.config/toot/config.json | grep access_token | awk -F':' '{print $2}' | awk -F'"' '{print $2}'`
  12. #echo $TOKEN
  13. #echo $ARTIST " " $TITLE " " $ALBUM
  14. curl -X POST \
  15. -d "title=$TITLE " \
  16. -d "album=$ALBUM " \
  17. -d "artist=$ARTIST " \
  18. -H 'Authorization: Bearer '$TOKEN \
  19. https://$INSTANCE/api/v1/pleroma/scrobble