Conversation
Notices
-
Attention! @p is now an admin on Baest :p:
- † top dog :pedomustdie: likes this.
- † top dog :pedomustdie: repeated this.
-
@sjw I did 9/11.
bushdid911.png
-
@lauralt @redneonglow @sjw There's a scrobble endpoint that is in some patched versions of Pleroma. What I'm using is kind of awful, but it's kind of just a prototype to see if it works:
while sleep 1; do cmus-remote -C status | mawk 'BEGIN{m["artist"]=m["album"]="Unknown";playing=1;duration=180} $1 == "status" && $2 != "playing" {playing=0} $1 == "position" {position=$2; if(position < 10){system("sleep 10");exit}} $1 == "file"{n=split($0, a, /\//);m["title"]=a[n]} $1 == "duration"{m["duration"] = $2} $1 != "tag"{next} {f=$2;$1=$2="";sub(/^ +/, "");gsub(/["'\''\\]+/, "");m[f]=$0} END{if(playing && position>10) { getline auth < ".p-baest-auth"; system(sprintf("curl %s -F \"album=%s\" -F \"artist=%s\" -F \"title=%s\" -F \"length=%d\" -X POST https://bae.st/api/v1/pleroma/scrobble | jq \"[.album, .artist, .id, .length, .title]\"", auth, m["album"], m["artist"], m["title"], m["duration"])); } wait = (m["duration"]-position); print m["duration"], position, wait; if(wait < 10 || position < 10)wait=10; system("sleep " wait)}'; done
A better plan would be to just open a pipe to cmus-remote instead of repeatedly invoking it, and then poll status periodically and update it when the song changes (and gets played instead of just skipping around). It's a new Activity type (I think "Audio"), so if you hit the endpoint for my account, it'll show you something like the last ten songs.
-
@p @redneonglow @sjw
What are you using to automatically update the song displayed over your posts?
-
@redneonglow @sjw No, just the box it was on is dead and I'm moving it to Revolver.
-
@sjw @p FSE is still down I see? Is it down for good?
-
@lauralt @redneonglow @sjw Ah, should be even easier in mpd.
Old friend of mine is (or maybe just was) one of the mpd hackers. He pushed it around the office some but it was really unfriendly back then. I helped him optimize some of the FLAC code for ARM (I think I was the only one in the office that knew ARM assembly and gcc's output was terrible, so you had to hand-optimize a lot of stuff. gcc still produces sub-optimal x86-like ARM code last I checked) so it'd run on his hacked iPod. He was optimizing the hell out of it because he needed free software to do gapless playback of FLACs. Really cool guy, great hacker, but also eccentric like you'd expect.
He had a clause in his employment contract that he would never be required to use non-free software. :chad:
-
@p @redneonglow @sjw
I know about the scrobble endpoint and I'm using it manually. Mint has it enabled on pleromaFE too.
I don't use cmus though. I'll probably write a similar one liner for mpd.