Using the TuneIn.com AIR API with ProppFrexx

You have a question or need an advice about how to do something? Ask it here!
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Using the TuneIn.com AIR API with ProppFrexx

Post by radio42 »

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:

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}
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?!
Attachments
TuneInOnSongTitleChanged.jpg
TuneInOnSongTitleChanged.jpg (86.02 KiB) Viewed 29406 times
friso
Posts: 173
Joined: 10 Apr 2012 10:05
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by friso »

Bernd

Is it also possible to send the information to tunein, and recieve the album art, so it can be displayed on a website?
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by radio42 »

No, that service is an internal service of tunein and they do not offer that to the clients.
friso
Posts: 173
Joined: 10 Apr 2012 10:05
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by friso »

Bernd

That's clear,
But when i use the build in functionality i have to make sure all the songs have album art.
So it would be nice to have a feature to auto add album art for selected or all tracks.
Maybe it can be added to the edit tags. You can do manually things per track there.
But in batch would be nice.

Is this possible?

Friso
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by radio42 »

There are no plans to add such a batch feature to ProppFrexx!

Also when you look to similar apps there are all pretty bad in detecting the correct image. Even the internal tunein.com service is often picking an incorrect album art.

There are a few services out there, but they are pretty expensiv. Would you pay a couple hundred euros every month for it?
XTended
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by XTended »

Hi Bernd,

Just a question when using the TuneIN API:

EXEC_SEND_HTTP_GET http://air.radiotime.com/Playing.ashx?p ... um=${album}

Do I have to include these tages too "< >" (<partnerid>, <partnerkey> and <stationid>) for getting this little script working?
Or without those tags?
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by radio42 »

It's without the <> !
XTended
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by XTended »

Thanks!
User avatar
yourx
Posts: 42
Joined: 04 Feb 2019 17:32
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by yourx »

Is there something changed proppfrexx is saying - The control command parameter contains macros - What is wrong in this line title=${title}&artist=${artist}&album=${album}
User avatar
radio42
Site Admin
Posts: 8329
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Using the TuneIn.com AIR API with ProppFrexx

Post by radio42 »

You probably hit the TEST button?!
The message is just a warning saying, that with the Test button it cannot evaluate certain macros.
E.g. the ${artist} macro is a track related macro, which is only availbale with certain events, e.g. the OnSongTitleChanged or OnTrackPlay event. But it is not available with the TEST button.

Post Reply