Using the TuneIn.com AIR API with ProppFrexx
Posted: 10 Apr 2014 21:03
The tunein.com AIR API allow broadcasters to send radio directory content to TuneIn in realtime - i.e. to update the 'Now Playing' information.
This little tutorial describes how to implement this within ProppFrexx ONAIR.
The TuneIn AIR API is described here: http://tunein.com/broadcasters/api/
The AIR API is basically a simple HTTP GET to send whenever a new track starts playing. And ProppFrexx supports exactly this out of the box very easily via its internal event system and its flexible control-commands as well as command macros.
The event to use best for this purpose is the Streaming.OnSongTitleChanged, as this event is exactly triggered with each new track being played and it also considers all the exclude filters and other 'Song Title Update' settings as configured in the 'Streaming' section.
The control-command to send a HTTP GET request is EXEC_SEND_HTTP_GET, this allows you to specify any arbitrary URI/URL as its parameter (as well as an optional username and password in case the server requires a basic authorization, which in this case is not needed).
As its parameter you directly use the URL as given in the AIR API documentation, but you can use the track macros ${title}, ${artist} and ${album} which are then replaced by the effective content whenever the song title change event is being triggered.
Example control-command for the Streaming.OnSongTitleChanged event: Please replace <partnerid>, <partnerkey> and <stationid> with your effective ids/keys as received from tunein.com!
As you can see, a single control-command can be used to implement the TuneIn AIR API - how simple is that?!
This little tutorial describes how to implement this within ProppFrexx ONAIR.
The TuneIn AIR API is described here: http://tunein.com/broadcasters/api/
The AIR API is basically a simple HTTP GET to send whenever a new track starts playing. And ProppFrexx supports exactly this out of the box very easily via its internal event system and its flexible control-commands as well as command macros.
The event to use best for this purpose is the Streaming.OnSongTitleChanged, as this event is exactly triggered with each new track being played and it also considers all the exclude filters and other 'Song Title Update' settings as configured in the 'Streaming' section.
The control-command to send a HTTP GET request is EXEC_SEND_HTTP_GET, this allows you to specify any arbitrary URI/URL as its parameter (as well as an optional username and password in case the server requires a basic authorization, which in this case is not needed).
As its parameter you directly use the URL as given in the AIR API documentation, but you can use the track macros ${title}, ${artist} and ${album} which are then replaced by the effective content whenever the song title change event is being triggered.
Example control-command for the Streaming.OnSongTitleChanged event:
Code: Select all
EXEC_SEND_HTTP_GET http://air.radiotime.com/Playing.ashx?partnerId=<partnerid>&partnerKey=<partnerkey>&id=<stationid>&title=${title}&artist=${artist}&album=${album}
As you can see, a single control-command can be used to implement the TuneIn AIR API - how simple is that?!