We maintain a
webpage of streams generated by Liquidsoap.
In order to register your radio on this page, a simple
register_flow is provided. If your stream is called
just wrap it as follows before outputting it:
Most parameters are pretty explicit:
radio is the name of the radio,
website is the url of the website of the radio, etc.
streams is a list of pairs of strings describing the format of the
stream and the url of the stream. We use a list here because one radio can be
broadcasted under multiple stream formats. The format should always be of the
codec if it is encoded in variable
You can register a stream with any
password parameters. Those
parameters are only useful if you use additional services such as the
command-line client, or if you want to claim that you “own” a registered radio.
All this is relatively informal for now, but may be tightened in future
developments of Flows.
Getting information from flows
List of radios
Note: When the list gets big enough, this API should be changed to return paginated results.
A list of radios, encoded in JSON format, can be obtained by querying the following url:
Output is a JSON string like this:
A single radio, encoded in JSON format, can be obtained by querying the following url:
All argument are optional and should be in UTF8 and properly encoded for a HTTP GET request.
A direct request using a radio's token can also be performed at this URL:
Output is a JSON string like this:
Flows can also be used to provide a single url for all your listeners, allowing you to change the actual listening url of your radio while preserving your playlists.
If you radio's token is
:token and has a stream of format
:format, then the
following url will redirect any request to your stream's URL.
As for streams, if you radio's token is
:token then the following link will
return a PLS) playlist:
It is oftentimes difficult to properly implement a regular update of your radio's currently playing information on a website or an online player. Using Flows, you can very easily implement real-time notifications of the song currently being played by your radio.
First, you need to know your radio's token. You can do so by querying a single radio, as described above, or querying all radios and finding yours in the list.
Received messages are objects of the form:
Messages with command
"metadata" are the one you want to use to update
information displayed about your radio.
Note: The twitter API is deprecated for now.
You can register twitter notifications on any twitter account with radio that you own. The API is designed to allow implementing this feature on your website. It works as follows:
First you issue a
GET request, authenticated with your radio
credentials at this address:
Then you should receive a response of the form:
You should then visit the returned url with a browser or redirect your website
visitor to this address. There, twitter should ask you to authorize the
Flows application for the twitter user that you or your visitor are using.
Once done, you should be automatically redirected to
the parameter passed in the initial
GET request. From this point, all
metadata updates for the that radio should be forwarded to the twitter account
that was just authorized.
A command-line client is also available. It can be used to:
- Change your radio's name
- Change your radio's location
- Register and unregister twitter notifications
The code is still being developped. It can be accessed at this url: https://github.com/savonet/flows-client