Prepper Broadcasting has returned to airtime.pro as Red Beacon Media. And I was looking over the changes that Airtime has done since we last used them to broadcast the radio station. They’ve added better smartblocks, and even included a new twitter feature which makes life a lot easier then it was.
Even with these improvements sometimes you need to just do things yourself.
One of the drawbacks of their current twitter add-on was that it only uses one twitter account, and the other being you really can’t customize the crap out of what you are sending to twitter.
I’ve used twitterfeed.com and @roundteam on twitter for ages, and I thought I would give it a go and see what I could do to customize the twitter accounts we use to display the “Now Playing” bits and other useful info we could use.
Turns out there is a json API data stream that is used for thier default player widgets, which means there is a lot more you can do then just tweet your now playing info.
Now Playing to multiple twitter accounts:
In the attachement below you will find a zip of sample files that your webmaster can use to customize just about anything you can think of for your site. I’ve included a nowplaying.php file which is in RSS Feed format.
Here are some tips on usage you might be interested in:
First un-compress the zip folder to a location on your web hosting, under /public_html/ a folder such as /twitterfeeds/ would be a good example if your going to use the example for twitterfeed.com
(I am assuming that your hosting control panel allow you to edit the files online, instead of editing first then uploading them to the site)
Next you have to edit a couple of files. The first file is the nowplaying.php file and make sure that the line “$config = “./atp-config.php” ;” is correct. (should be if you place everything in the same path from the zip).
Next edit the “api-config.php” file. All of the settings in this file are pretty much easy to understand, except maybe the $radioid one. If you go to your widgets and get the source code for the widget they provide you can see the radio id in the url as the first set of characters, for example:
You need to get this right or the script will not work.
Since the example I am giving in the zip file is intended to be used by twitterfeed I don’t include a way of storing the data in a mysql database so we don’t swamp the airtime server with requests for the api data. If you use the main functions for anything that calls the api a lot, you should send the data to a database from a separate crontab so that your not asking for it every ten seconds. Twitterfeed’s lowest setting is every 30 minutes, I just call the api directly in the nowplaying.php file.
Some other ideas….
Import To WordPress:
I included a sample-array-data.txt file in the zip. There are a lot of items in the php array that is produced by the functions in the hack. You could create a feed that could be imported directly into wordpress containing all the information of an upcoming podcast/show for example (Or Archive info on past shows), using the wordpress plugin called FeedWordPress (Author: Charles Johnson).
Automate reporting of Royalties for copyrighted music:
Storing the API data into a MySql database with the timestamps included would allow you to set up automatic reporting to services which handle licensing of copyrighted music for your radio station. You just have to make sure you send it to them in the correct format an time schedule.
Compare Music and Shows Played with Listener Stats:
It would take much more effort to compare your listen stats, blog stats, and other sources of visitors to your radio station streams and the API data collected into a database to figure out what works best. Maybe the show you are playing would work better at 6pm instead of 8pm? Maybe you loose listeners everytime you play the music your brother made? All these kinds of questions could be answered by have a searchable database of different stat sources to compare them, the API data from airtime pro would be just one of them.
Search and Replace Data:
If you are using the stats to pay for royalities, but also want to use the data to display a custom add-on to a player so that the current song has a shopping link in your store, you could set up a simple search and replace scheme in your script to display the shopping link based on the tracks url.
MP3 Tags could be used better:
One of the things that really annoyed me about having to import mp3 files into radio the station (Thank You Air Time for the RSS Import smartblock HUGE IMPROVEMENT!) is that the podcast DJ’s never added album art etc, of used MP3 tag editors to include author names, etc… In even the sample data I include in the zip you can see a lot is missing. Making sure that information is there can help you do a lot more with this hack, and it’s good practice. Cover art would allow you to include an image with an amazon affiliate link to have your listeners download a copy of your music or shows. Not to mention a host of other stuff I can’t even begin to think about.
Any other ideas or improvements? Leave a comment.
Dan is a Linux geek who still writes in BASH for fun, a scripting language used by UNIX & Linux to run back end processes. He has spent the last 20+ years actively learning and writing, about the self-reliance lifestyle.
Dan grew up in Toronto, Ontario and met his wife Carol of 25 years. They moved to the outskirts of Vancouver, British Columbia in the early ‘90’s where they raised four sons. Now a new grandfather, he is more than ever inspired to help educate people to properly prepare for emergencies.