I didn't have time to look into the Web widgets myself yesterday, but now I did.
In fact it's pretty easy to get all the info you like.
The API looks like this:
Queue/Coming up:
Code:
https://samweb.spacialaudio.com/webapi/station/<SID>/queue?token=<token>&top=<count>&format=json&callback=cb
Example:
https://samweb.spacialaudio.com/webapi/ ... allback=cbHistory/Recently played:
Code:
https://samweb.spacialaudio.com/webapi/station/<SID>/history?token=<token>&top=<count>&format=json&callback=cb
Example:
https://samweb.spacialaudio.com/webapi/ ... allback=cbResponse Format is JSONP (a human can easily decode JSON from that, it's basically a JavaScript function call with an object containing the result as the sole parameter)
You can get the SID from the listen link for normal players. The token is the last part of the id of the div where the widget is rendered in.
This for example would be the widget for one of my SAM Vibe stations:
Code:
<div id='widgets-now--63a5dd2a3dcfe97a2488ee866e360404970353d4'></div>
The widget script extracts the token as whatever is written after the third - in the id attribute.
If you don't want to code yourself, the API script is pretty well readable (at least if you skip the first couple hundred lines that just contain a minified version of jQuery and only read the code written by Spacial)
http://media.spacial.com/widgets/samcloud-webapi.jsAnd this would be the widget script that calls the API functions and renders the Widget in HTML:
http://media.spacial.com/widgets/widget ... pe=definedThe API has different base URLs depending on the environment, but I think all the SAM Vibe instances "out in the wild" run on the production environment.