How to get the name of the current song using Sonos API (SMAPI) - sonos

I'd like to get the name of the currently playing song using Sonos Music API.
Is there a way of getting the currently playing song name without subscribing and waiting for a callback (using playbackMetadata)?
Ideally a simple GET Http request.
Thanks!

This works for me
curl "http://192.168.49.119:5005/zones" | jq '.[].coordinator.state.currentTrack.title'

Related

Twitter API V2 video url

I'm trying to fetch a tweet's video url using API V2.
Using API V1.1 I can use
https://api.twitter.com/1.1/statuses/show.json?id=<ID>&include_entities=true
and get the direct mp4 urls in the response at
extended_entities.media[0].video_info.variants
But using API V2 I can't seem to find any ways to get those, I was only able to get the video thumbnail but not the actual video.
I've tried it with both the lookup and the recent search endpoints but couldn't find a way to do that.
In lookup docs twitter says:
This endpoint was recently graduated from Twitter Developer Labs, and is the replacement of v1.1 statuses/show, v1.1 statuses/lookup, and Labs Tweet lookup. If you are currently using any of these endpoints, you can use our migration materials to start working with this new endpoint.
but that doesn't seem to be the case, is that feature not included ? Also if there is any other way to be able to embed a twitter video in a web page (without the tweet text) that'd be helpful.
The videos are not currently available in the Twitter API v2 at this time. This is a known request.
For those who still looking for an answer, you can do it on the V2 by adding the following parameters :
expansions=attachments.media_keys
media.fields=variants
Your final link should give https://api.twitter.com/2/users/{{uid}}/tweets?expansions=attachments.media_keys&media.fields=variants
Source : https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/media
Progress on twitter-api-v2 media handling, Maybe this will allow the video URLs too in the response.
https://twittercommunity.com/t/v1-1-media-endpoints-available-for-essential-access-in-the-twitter-api-v2/171664

How To Play Specified Google Play Music Resources (Albums) via Sonos API

I have ~300 vinyl records which I want to attach RFID tags to so I can place one on an RFID reader and trigger playback of the album on my home Sonos (using Google Play Music).
Is there a way to load a specified resource from a service into a group? I was able to follow through the Postman tutorial, and was maybe thinking that I could set up each album as a Sonos Favorite and load that, but I'm looking around and see that there is a (very low) limit on how many favorites you can have, so this doesn't seem like a workable solution anymore. I've been digging around the APIs and can't quite find what I'm looking for in the Control API.
Ideally I'd have each RFID tag contain something along the lines of artist name, album name, and some Google-Play-Music-specific album ID, which I can use to load the album into a fixed Sonos Group queue. If there's a better approach, however, I'm also all ears.
The Sonos API doesn't offer a way to load and play content from another service (other than commands in the favorites namespace) unless that service provides an interface to get the Sonos IDs without authentication. An alternative is to host your own files and build a SMAPI server or use a mediaUrl to your audio file in the track.
See the SMAPI sample server and Tracks in the cloud queue in Play audio (cloud queue) for details.

Add song to Spotify Queue through Spotify API

With the new endpoint /player of the Spotify Web API we can now control the playback of a Spotify Client. With the endpoint https://api.spotify.com/v1/me/player/play we can add a song to be played.
I was wondering if there is a way to utilize the new endpoints to add a song to the players' queue. I'm planning to write an app to let multiple guests request songs that can be played through Spotify on a party.
Does anyone have an idea?
Okay, I found myself an answer. This feature is right now not supported. But it seems that this is not too far away on their roadmap.
https://github.com/spotify/web-api/issues/462
I might be wrong but could it be a workaround to use a playlist in which you add/reorder tracks as much as you want during its playback ?
I know you can do this with the API :
https://developer.spotify.com/documentation/web-api/reference/playlists/
They finally added the ability to add a song to a user's queue! Try it out here

Soundcloud API - Find Playlists that Contain a Specific Song

After exploring, and experimenting with SoundCloud's API - it's not possible to find what playlists contain a certain song...
However, SoundCloud uses a simple URL format to show which playlists contain certain songs - https://soundcloud.com/ARTIST/SONG/sets
For example: https://soundcloud.com/ultrarecords/cheerleader-felixjaehnremix/sets
Is there any way to scrape the playlist IDs off a web URL such as the above? I've tried to curl the page and it doesn't give the IDs of the playlists.
It is possible.
Go to the site, open the developer console, go to the network tab and look at the xhr requests.
While looking at the requests you will find these endpoints, they are part of the next api version:
https://api-v2.soundcloud.com/tracks/150483650
https://api-v2.soundcloud.com/tracks/150483650/playlists?limit=10

get the data from soundcloud and reverbnation for a windows 8 app

I am trying to create a windows 8 app for a particular band who have stored their songs on
Reverbation and soundcloud. My problem is that i dont know how to get those contents from these sites...I tried creating an rss feed using feedburner but that failed. Is there any way where i can get the feed or the data for my app.
SoundCloud has a well documented API. You can check yourself if the functionality you require is available.
ReverbNation on the other hand doesn't seem to have a public API available at the moment. There's only an API link in the page footer which opens a dialog for subscribing to any news regarding that via email.