I’m trying to figure out how to get individual values for track name and track artist for every single song that is played through sonos, and set those as global variables. I’ve tried several things from looking at other codes, which sometimes works, but cannot figure out how to extract that information.
I thought maybe i could go through last.fm scrobble data, and I’m able to get info from that, which looks like this.
{“recenttracks”:{“track”:[{“artist”:{"#text":“Cottontail”,“mbid”:""},“name”:“Storyteller”,“streamable”:“0”,“mbid”:"",“album”:{"#text":“Chimney Chat”,“mbid”:""}
But the issue is still I suppose parsing that data. Ultimately the goal is to create an alexa routine, that when I say “i like this song” will make a request to webcore to get whatever song is currently playing, then send that information to ifttt’s spotify channel, to find that song and save it. This sounds so remarkably simple that I can’t imagine there isn’t a solution for people without node.js, but I’ve spent hours searching and have found no way to accomplish this.
Currently, when I send the track data of the sonos as a value to ifttt, the song, artist, and album are sent as one value, when it asks for two values, one a song name, the other, an artist. When all of it is as one value, the applet fails.
If anyone is able to break this down for me, it would be greatly appreciated.