cinerion on Nostr: John Paul Grips eris I listen to my music using mpd and ncmpcpp. Everytime there is a ...
John Paul Grips (nprofile…lq09) eris (nprofile…ltwp) I listen to my music using mpd and ncmpcpp.
Everytime there is a song change, ncmpcpp executes a script that updates the song on pleroma:
#! /bin/env sh
TOKEN=$(cat "$HOME/var/mpd-scrobble/token.txt")
INSTANCE="cawfee.club"
TITLE=$(mpc current -f %title%)
ARTIST=$(mpc current -f %artist%)
ALBUM=$(mpc current -f %album%)
curl -s -X POST \
-d "title=$TITLE " \
-d "album=$ALBUM " \
-d "artist=$ARTIST " \
-H 'Authorization: Bearer '"$TOKEN" \
https://$INSTANCE/api/v1/pleroma/scrobble > /dev/null
To get the token I use this site: https://prplecake.github.io/pleroma-access-token/ , fill the fields, select scope: write, and give oauth access through pleroma and get the first value, access_token, which I save to the location on the script.
I downloaded the page and ran it locally to get the auth token to be sure, it seems fine, I guess. If I ever post something unlike me, it's because I got hacked because of this![:yuihehe:](https://cawfee.club/emoji/custom/yuihehe.png)
Everytime there is a song change, ncmpcpp executes a script that updates the song on pleroma:
#! /bin/env sh
TOKEN=$(cat "$HOME/var/mpd-scrobble/token.txt")
INSTANCE="cawfee.club"
TITLE=$(mpc current -f %title%)
ARTIST=$(mpc current -f %artist%)
ALBUM=$(mpc current -f %album%)
curl -s -X POST \
-d "title=$TITLE " \
-d "album=$ALBUM " \
-d "artist=$ARTIST " \
-H 'Authorization: Bearer '"$TOKEN" \
https://$INSTANCE/api/v1/pleroma/scrobble > /dev/null
To get the token I use this site: https://prplecake.github.io/pleroma-access-token/ , fill the fields, select scope: write, and give oauth access through pleroma and get the first value, access_token, which I save to the location on the script.
I downloaded the page and ran it locally to get the auth token to be sure, it seems fine, I guess. If I ever post something unlike me, it's because I got hacked because of this
![:yuihehe:](https://cawfee.club/emoji/custom/yuihehe.png)
![](https://cawfee.club/media/f9/ed/f8/f9edf846998b3c04703e0e1e1fb95b6ad62ad68eaaba2c583560403bc1352441.png)