The Schedule RSS feed, linked from the dashboard, provides information about a channel’s upcoming schedule in RSS (XML) format. There are a few options about how much data to have this service return.
To get the schedule for a specific channel as XML, you can pass the Channel ID, for example:
http://myserver/xml/program_schedule_feed/[?channel_id=1-20]
Substitute your server’s hostname, domain, or IP address for myserver. Optional parameters are show in brackets [].
myserver
channel_id
Integer
start
DataTime
YYYYMMDD
end
Examples of valid URL parameters and what they return:
http://myserver/xml/program_schedule_feed/
http://myserver/xml/program_schedule_feed/?channel_id=1
http://myserver/xml/program_schedule_feed/?channel_id=4
http://myserver/xml/program_schedule_feed/?channel_id=3&start=YYYYMMDD&end=YYYYMMDD
http://myserver/xml/program_schedule_feed/?channel_id=3&end=YYYYMMDD
http://myserver/xml/program_schedule_feed/?channel_id=1&start=YYYYMMDD
Testing different feed parameters can be done with a web browser. The /xml/program_schedule_feed URL displays a basic RSS 2.0 feed of the channel schedule.
/xml/program_schedule_feed
In your browser, go to http://myserver/xml/program_schedule_feed/ (substitute the hostname of your server).
The date is presented in RFC 2822 format, commonly used in email formatting. This format contains both relative time (that is, modified by time zone), and the timezone information (represented as +/- Greenwich Mean Time). The example below uses GMT -5, or Eastern Standard Time. The timezone information is placed at the end of the title string after a ” – ” separator.
In all programming languages, to get the desired date format:
PHP’s strtotime() function can read RFC2822 directly. That converts it to a Unix timestamp (seconds since the epoch). Other PHP date functions then take that timestamp directly. For example, Date takes a date format string to return just “10:00 PM” in this example string.
strtotime()
The first function parses off the RFC time and turns it into a Javascript Date object, a built-in object in Javascript. The second function takes a date object, and returns just “10:00 PM”.
One way to call the two Javascript functions is:
Here is an example RSS feed XML response:
<rss xmlns:psg=”http://192.168.41.126:80/psg_namespace/” version=”2.0″> <channel> <title>Channel 1</title> <description>Broadcast Channel 1</description> <item> <title>Ad Council – Energy Efficiency</title> <pubDate>Thu, 07 Mar 2019 17:00:00 -0500</pubDate> <psg:eventId>19</psg:eventId> <psg:duration>30</psg:duration> <psg:end_datetime>Thu, 07 Mar 2019 17:00:30 -0500</psg:end_datetime> <psg:programCode/> <psg:episode>Cliff</psg:episode> <psg:episodeCode/> <psg:thumbnail>http://192.168.41.126/thumbnails/16.jpg?1551989877</psg:thumbnail> <psg:mediumId/> <vodURL/> <description> New PSAs released in 2011 encourage homeowners to save energy by taking actions around the home. The PSAs offer practical ideas for reducing household energy consumption, and saving money in the process. </description> <link>http://10.10.10.10</link> <guid>AC1F6B49B180-19</guid> </item> </channel> </rss>
Several key fields of the content metadata are made available, including the Program field (in the title element), the description, the thumbnail, and duration.
A Note on What “Title” Contains in the RSS. For each content file, if you fill in the “Program” metadata field, then “Program” is the string presented as “title” in the RSS. Otherwise, the filename is presented in the RSS. The fields Program Code, Episode, and Episode Code have no impact here. The RSS title will be “Program” or, if Program is blank, the filename.
<?xml version=”1.0″ encoding=”UTF-8″?> <hash> <errors>There were problems with your schedule query parameters. An invalid channel was specified.</errors> </hash>
3.6.5