LibreTime Radio Automation


An open source radio automation server made for (and made by) low-power FM stations and the rest of us.

View the Project on GitHub LibreTime/libretime

About LibreTime
Contribute to LibreTime

Quick Install
  -- Host Configuration
  -- Setting the Server Time
  -- Configuring Track Types
  -- Setting up SSL

Using LibreTime
Preparing Media
Scheduling Shows
Broadcasting Live
Adding Users
  -- More Tutorials

Radio Broadcasting 101
UNESCO Public Radio Guide

HD Audio Modules
Rights and Royalties
Media Folders used by LibreTime

Exporting the schedule

LibreTime has a feature which enables your station’s show and schedule information to be displayed on remote websites. This feature is included in LibreTime because you would not usually invite the general public to access your LibreTime server directly. If you had very large numbers of people requesting data from the LibreTime server at once, the burst of network traffic might overload the server, potentially disrupting your broadcasts. If carried out maliciously, this network overload is known as a denial of service attack.

Instead, your public-facing web server can retrieve the schedule information from the LibreTime API. This information can then be displayed on your broadcast station or affiliate websites by a content management system, such as Sourcefabric’s Newscoop ( It can be presented using Javascript widgets and styled with CSS, in any format that you require. The Broadcaster theme for Newscoop ( integrates these widgets with ready-to-use styles.

There are two kinds of information that can be retrieved remotely from the LibreTime API without authentication; the metadata for the current show plus the following show (live-info), or the schedule for the current week and the week ahead (week-info). The week-info metadata includes show names, times, and individual show URLs on your public website. That way, the audience for your station can click through from the schedule information to find out more about a particular show, or download a previous show recording that you might have made available.

If your LibreTime server was accessible at the live show information could be retrieved by your web server using this URL:

The comma-separated text metadata returned to your web server might be something like this:

"schedulerTime":"2013-07-03 14:07:31",

"previous":{"name":"Earth, Wind & Fire - Boogie Wonderland",
"starts":"2013-07-01 22:53:00",
"ends":"2013-07-01 22:55:00",
"current":{"name":"Deodato - Also Sprach Zarathustra",
"starts":"2013-07-03 13:07:06",
"ends":"2013-07-03 13:16:05",

"name":"Rock Show",
"start_timestamp":"2013-07-03 14:00:00",
"end_timestamp":"2013-07-03 15:00:00",
"starts":"2013-07-03 14:00:00",
"ends":"2013-07-03 15:00:00",

"currentShow":[{"start_timestamp":"2013-07-03 14:07:00",
"0":"2013-07-03 13:07:00",
"end_timestamp":"2013-07-03 15:00:00",
"1":"2013-07-03 14:00:00",
"name":"Funk Show",
"2":"Funk Show",
"starts":"2013-07-03 14:07:00",
"7":"2013-07-03 13:07:00",
"ends":"2013-07-03 15:00:00",
"8":"2013-07-03 14:00:00"}],

"name":"Rock Show",
"start_timestamp":"2013-07-03 15:00:00",
"end_timestamp":"2013-07-03 16:00:00",
"starts":"2013-07-03 15:00:00",
"ends":"2013-07-03 16:00:00",


The information for the current week’s schedule could be retrieved using the URL:

In this case, the metadata returned would be in a different format from the above example, something like the following. To keep the example short, this particular schedule export only contains four shows on a Monday. A full weekly schedule export would contain a great deal more text.


{"start_timestamp":"2013-07-01 12:05:00",
"end_timestamp":"2013-07-01 13:00:00",
"name":"Elvis Show",
"starts":"2013-07-01 12:05:00",
"ends":"2013-07-01 13:00:00"},

{"start_timestamp":"2013-07-01 13:00:00",
"end_timestamp":"2013-07-01 14:00:00",
"starts":"2013-07-01 13:00:00",
"ends":"2013-07-01 14:00:00"},

{"start_timestamp":"2013-07-01 14:00:00",
"end_timestamp":"2013-07-01 15:00:00",
"name":"Funk Show",
"starts":"2013-07-01 14:00:00",
"ends":"2013-07-01 15:00:00"},

{"start_timestamp":"2013-07-01 15:00:00",
"end_timestamp":"2013-07-01 17:30:00",
"name":"Rock Show",
"starts":"2013-07-01 15:00:00",
"ends":"2013-07-01 17:30:00"},



If you see the message You are not allowed to access this resource when attempting to display schedule information in your web browser, log in to the LibreTime administration interface, click System in the main menu, then Preferences. Set Allow Remote Websites To Access “Schedule” Info? to Enabled, click the Save button, then refresh the browser window opened on the schedule export URL. If you do not wish to make schedule information available to the public, set this option to Disabled instead.

Caching schedule information

If the LibreTime server is behind a firewall, or you want to protect the LibreTime server from large numbers of schedule requests, you may wish to cache the schedule information on a public-facing or intermediate server. You can then create a firewall rule that only allows the schedule server to connect to the LibreTime server, in addition to any remote users of the LibreTime web interface.

Your system administrator can set up schedule caching on a standard Apache and PHP enabled web server with the curl program installed, using the following steps:

  1. Create a shell script on the schedule server ( that polls the remote LibreTime server (, and writes the metadata returned into a pair of local temporary files:

    sudo nano /usr/local/bin/

The content of this file should be like the following script, replacing with the name of your LibreTime server:


curl -s "***" > /tmp/live-info

curl -s "***" > /tmp/week-info
  1. Make the script executable:

    sudo chmod +x /usr/local/bin/

  2. Create an Apache VirtualHost configuration for the schedule server:

    sudo nano /etc/apache2/sites-available/schedule

containing a definition like the following, replacing with the name of your schedule server:

<VirtualHost *:80>
   DocumentRoot /var/www/schedule/
  1. In the schedule server’s DocumentRoot folder, create the folders api/live-info/ and api/week-info/

    sudo mkdir -p /var/www/schedule/api/live-info/ sudo mkdir -p /var/www/schedule/api/week-info/

  2. Create an index.php file in the api/live-info/ folder:

    sudo nano /var/www/schedule/api/live-info/index.php

containing the following code:

$filename = '/tmp/live-info';  // define here the path and name of uploaded live-info file

header('Content-Type: text/javascript');
header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");

$callback = empty($_GET['callback']) ? null : $_GET['callback'];
$content = file_get_contents($filename);
$content = str_replace('***', $callback, $content);
echo $content;
  1. Create an index.php file in the api/week-info/ folder:

    sudo nano /var/www/schedule/api/week-info/index.php

containing the following code:

$filename = '/tmp/week-info';  // define here the path and name of uploaded week-info file

header('Content-Type: text/javascript');
header("Expires: Thu, 01 Jan 1970 00:00:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");

$callback = empty($_GET['callback']) ? null : $_GET['callback'];
$content = file_get_contents($filename);
$content = str_replace('***', $callback, $content);
echo $content;
  1. Enable the new configuration and reload the Apache web server:

    sudo a2ensite schedule sudo /etc/init.d/apache2 reload

  2. Create a cron job to run the shell script each minute:

    sudo nano /etc/cron.d/libretime-schedule

containing the line:

* * * * * www-data /usr/local/bin/

The schedule server will now be serving the same show information as the LibreTime server, with a cache lifetime of one minute. You can adjust the cache lifetime by altering the frequency of the cron job that polls the LibreTime server.

Pushing schedule information via FTP or SSH

If there is no inbound access to the LibreTime server at all, an FTP script can be used to push cached schedule data from LibreTime to an external web server. The standard ftp command should be available on the LibreTime server and the external web server should have a suitably restricted FTP account set up. After following steps 1 and 2 above to export schedule data to a pair of temporary files on the LibreTime server, create a new script on the LibreTime server to automatically make the upload:

sudo nano /usr/local/bin/

Replace host, user and password values with appropriate values for your external web server:


ftp -n -v $HOST << EOT
put /tmp/airtime-week-info
put /tmp/airtime-live-info

Then make the new script executable and create a cron job to launch it every minute, as in step 8 above. Steps 3 to 7 above should be carried out on the external web server so that it can convert the two temporary files uploaded via FTP into public schedule data.

If you have secure shell access (SSH) to the remote web server, you could write a script to use the secure copy command (scp) instead of ftp.