Change Airtime to Libretime in the docs; fix a few typos
This commit is contained in:
parent
0370dfb7cd
commit
3ed48e9ecb
7 changed files with 50 additions and 56 deletions
|
@ -1,12 +1,12 @@
|
|||
Airtime has a feature which enables your station's show and schedule information to be displayed on remote websites. This feature is included in Airtime because you would not usually invite the general public to access your Airtime server directly. If you had very large numbers of people requesting data from the Airtime 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*.
|
||||
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 Airtime API. This information can then be displayed on your broadcast station or affiliate websites by a content management system, such as Sourcefabric's **Newscoop** (<http://newscoop.sourcefabric.org/>). It can be presented using Javascript widgets and styled with CSS, in any format that you require. The **Broadcaster** theme for Newscoop (<https://github.com/newscoop/theme-Broadcaster>) integrates these widgets with ready-to-use styles.
|
||||
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** (<http://newscoop.sourcefabric.org/>). It can be presented using Javascript widgets and styled with CSS, in any format that you require. The **Broadcaster** theme for Newscoop (<https://github.com/newscoop/theme-Broadcaster>) integrates these widgets with ready-to-use styles.
|
||||
|
||||
There are two kinds of information that can be retrieved remotely from the Airtime 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.
|
||||
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 Airtime server was accessible at https://airtime.example.com the live show information could be retrieved by your web server using this URL:
|
||||
If your Libretime server was accessible at https://libretime.example.com the live show information could be retrieved by your web server using this URL:
|
||||
|
||||
https://airtime.example.com/api/live-info/?callback
|
||||
https://libretime.example.com/api/live-info/?callback
|
||||
|
||||
The comma-separated text metadata returned to your web server might be something like this:
|
||||
|
||||
|
@ -70,7 +70,7 @@ The comma-separated text metadata returned to your web server might be something
|
|||
|
||||
The information for the current week's schedule could be retrieved using the URL:
|
||||
|
||||
https://airtime.example.com/api/week-info/?callback
|
||||
https://libretime.example.com/api/week-info/?callback
|
||||
|
||||
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.
|
||||
|
||||
|
@ -126,32 +126,32 @@ In this case, the metadata returned would be in a different format from the abov
|
|||
"sunday":[],
|
||||
"AIRTIME_API_VERSION":"1.1"})
|
||||
|
||||
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 Airtime 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.
|
||||
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 Airtime server is behind a firewall, or you want to protect the Airtime 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 Airtime server, in addition to any remote users of the Airtime web interface.
|
||||
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 (schedule.example.com) that polls the remote Airtime server (airtime.example.com), and writes the metadata returned into a pair of local temporary files:
|
||||
1. Create a shell script on the schedule server (schedule.example.com) that polls the remote Libretime server (libretime.example.com), and writes the metadata returned into a pair of local temporary files:
|
||||
|
||||
sudo nano /usr/local/bin/airtime-schedule.sh
|
||||
sudo nano /usr/local/bin/libretime-schedule.sh
|
||||
|
||||
The content of this file should be like the following script, replacing airtime.example.com with the name of your Airtime server:
|
||||
The content of this file should be like the following script, replacing libretime.example.com with the name of your Libretime server:
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
curl -s "https://airtime.example.com/api/live-info/?callback=***" > /tmp/live-info
|
||||
curl -s "https://libretime.example.com/api/live-info/?callback=***" > /tmp/live-info
|
||||
|
||||
curl -s "https://airtime.example.com/api/week-info/?callback=***" > /tmp/week-info
|
||||
curl -s "https://libretime.example.com/api/week-info/?callback=***" > /tmp/week-info
|
||||
|
||||
2. Make the script executable:
|
||||
|
||||
sudo chmod +x /usr/local/bin/airtime-schedule.sh
|
||||
sudo chmod +x /usr/local/bin/libretime-schedule.sh
|
||||
|
||||
3. Create an Apache VirtualHost configuration for the schedule server:
|
||||
|
||||
|
@ -214,18 +214,18 @@ containing the following code:
|
|||
|
||||
8. Create a cron job to run the shell script each minute:
|
||||
|
||||
sudo nano /etc/cron.d/airtime-schedule
|
||||
sudo nano /etc/cron.d/libretime-schedule
|
||||
|
||||
containing the line:
|
||||
|
||||
* * * * * www-data /usr/local/bin/airtime-schedule.sh
|
||||
* * * * * www-data /usr/local/bin/libretime-schedule.sh
|
||||
|
||||
The schedule server will now be serving the same show information as the Airtime 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 Airtime server.
|
||||
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 Airtime server at all, an FTP script can be used to push cached schedule data from Airtime to an external web server. The standard ftp command should be available on the Airtime 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 Airtime server, create a new script on the Airtime server to automatically make the upload:
|
||||
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/upload-schedule-data.sh
|
||||
|
||||
|
@ -252,15 +252,15 @@ If you have secure shell access (SSH) to the remote web server, you could write
|
|||
Website widgets
|
||||
---------------
|
||||
|
||||
Example HTML, Javascript and CSS code for your public website are provided in the *widgets* folder of the Airtime installation tarball, or on GitHub: <https://github.com/sourcefabric/Airtime/tree/master/widgets>
|
||||
Example HTML, Javascript and CSS code for your public website are provided in the *widgets* folder of the Libretime installation tarball, or on GitHub: <https://github.com/sourcefabric/Libretime/tree/master/widgets>
|
||||
|
||||
If you have performed an automated installation on Debian or Ubuntu, the widgets can be found in the */usr/share/doc/airtime/examples/* directory.
|
||||
If you have performed an automated installation on Debian or Ubuntu, the widgets can be found in the */usr/share/doc/libretime/examples/* directory.
|
||||
|
||||
For the widgets to work on a typical web server, links to the Javascript and CSS code have to be included in the HTML page <head> element, like the following example:
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Airtime widgets</title>
|
||||
<title>Libretime widgets</title>
|
||||
<script src="js/jquery-1.6.1.min.js" type="text/javascript">
|
||||
</script>
|
||||
<script src="js/jquery-ui-1.8.10.custom.min.js" type="text/javascript">
|
||||
|
@ -270,7 +270,7 @@ For the widgets to work on a typical web server, links to the Javascript and CSS
|
|||
<link href="css/airtime-widgets.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
A full example is shown in the *widgets/sample\_page.html* file in the Airtime installation tarball, on GitHub, or in the */usr/share/doc/airtime/examples/* directory if you have installed the Debian/Ubuntu package of Airtime.
|
||||
A full example is shown in the *widgets/sample\_page.html* file in the Libretime installation tarball, on GitHub, or in the */usr/share/doc/airtime/examples/* directory if you have installed the Debian/Ubuntu package of Libretime.
|
||||
|
||||
The following code is for a small *airtimeLiveInfo* widget that displays information about the current show (show time elapsed, and show time remaining), as well as some information about the next show (start time and end time). In this example, the label text for *onAirNow* is translated into French for local language support:
|
||||
|
||||
|
@ -292,7 +292,7 @@ On the public website, this widget can be made to look like the following screen
|
|||
|
||||

|
||||
|
||||
The CSS properties *color:* and *text-transform:uppercase* have been used to style the *onAirNow* label. There is a full example CSS file *widgets/css/airtime-widgets.css* in the Airtime installation tarball, GitHub repository, or */usr/share/doc/airtime/examples/* directory on Debian/Ubuntu.
|
||||
The CSS properties *color:* and *text-transform:uppercase* have been used to style the *onAirNow* label. There is a full example CSS file *widgets/css/airtime-widgets.css* in the Libretime installation tarball, GitHub repository, or */usr/share/doc/airtime/examples/* directory on Debian/Ubuntu.
|
||||
|
||||
A variation on this widget displays the item being played out, rather than the show names:
|
||||
|
||||
|
@ -352,11 +352,11 @@ The <div> element for this widget would be:
|
|||
|
||||
<div id="scheduleTabs"></div>
|
||||
|
||||
Using the code above and the CSS and image files provided with Airtime, the weekly schedule can be styled to look like this:
|
||||
Using the code above and the CSS and image files provided with Libretime, the weekly schedule can be styled to look like this:
|
||||
|
||||

|
||||
|
||||
Optionally, you can display the schedule for the week ahead, as well as the current week. This requires the Javascript file *jquery.showinfo.js* supplied with Airtime 2.5.0 or later, where the value of the variable *dow* (for days of the week) includes fourteen rather than seven days:
|
||||
Optionally, you can display the schedule for the week ahead, as well as the current week. This requires the Javascript file *jquery.showinfo.js* supplied with Libretime 2.5.0 or later, where the value of the variable *dow* (for days of the week) includes fourteen rather than seven days:
|
||||
|
||||
var dow = ["monday", "tuesday", "wednesday", "thursday", "friday",
|
||||
"saturday", "sunday", "nextmonday", "nexttuesday",
|
||||
|
@ -372,4 +372,4 @@ In that case, the labels for the days of the week could be configured as follows
|
|||
nextthursday:"Next Thursday",nextfriday:"Next Friday",
|
||||
nextsaturday:"Next Saturday", nextsunday:"Next Sunday"},
|
||||
|
||||
The value of **sourceDomain** in the code examples above should match the URL that you wish to serve schedule information to the public from. If you have used the *Caching schedule information* method detailed above, this would be the URL of your schedule server, not the Airtime server directly.
|
||||
The value of **sourceDomain** in the code examples above should match the URL that you wish to serve schedule information to the public from. If you have used the *Caching schedule information* method detailed above, this would be the URL of your schedule server, not the Libretime server directly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue