scrobble-me.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. #
  3. # Copyright 2023 Jeff Cliff
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program at COPYING.GPL. If not, see <https://www.gnu.org/licenses/>.
  17. #
  18. HOME=/home/themusicgod1
  19. INSTANCE=shitposter.world
  20. #echo "
  21. TITLE=`cat /tmp/scrobblescript-title`;
  22. #echo "ARTIST:"
  23. ARTIST=`cat /tmp/scrobblescript-artist`;
  24. #echo "ALBUM:"
  25. ALBUM=`cat /tmp/scrobblescript-album`;
  26. echo "TOKEN:"
  27. TOKEN=`cat $HOME/.config/toot/config.json | grep access_token | awk -F':' '{print $2}' | awk -F'"' '{print $2}'`
  28. #echo $TOKEN
  29. #echo $ARTIST " " $TITLE " " $ALBUM
  30. curl -X POST \
  31. -d "title=$TITLE " \
  32. -d "album=$ALBUM " \
  33. -d "artist=$ARTIST " \
  34. -H 'Authorization: Bearer '$TOKEN \
  35. https://$INSTANCE/api/v1/pleroma/scrobble