Media RSS
Contents
Media RSS extends the capabilities of RSS feeds by allowing the inclusion of media content, including videos, pictures, and files. The easy-to-use Media RSS interface allows users to add media content to their feeds without the need for any special programming or technical knowledge.
This section is intended to help users become familiar with the Media RSS interface. Several applications of Media RSS will be presented.
Implementation of Media RSS is covered in later sections. Specifically, section 2 introduces the media namespace and XML tagging structure, and section 3 covers Media RSS in Template Control File (TCF) templates.
More information about RSS feeds can be found on the following support pages:
1.1 The Media RSS Interface
If an RSS feed has been associated with a page, the Add/Edit RSS Item icon will appear as shown in the figure below:
Figure 1.1: Add/Edit an RSS Item
Clicking on the button highlighted in figure 1.1 will open the New RSS Item window. Here the user may enter a title, description, link, author, publication date, or additional xml nodes to be included with the RSS Item. The publication date and RSS extras fields are optional. If a publication date is not specified, the date will be automatically set to the date the page is published. This form is shown in the following screen capture (figure 1.2):
Figure 1.2: New RSS Item Window
Once the RSS item has been created, Media RSS content can be added to it. To do this, click on the Add Media Content link, as shown in figure 1.3:
Figure 1.3: Update RSS Item window, showing the Add Media Content link
Clicking the Add Media Content link will open the New RSS Media Content screen. Here the user may add a media url (link), title, description, image thumbnail, and list of keywords. The media link and thumbnail fields allow the user to select a file on the server using a filechooser dropdown menu. Once the form has been completed to your satisfaction, press the Save button to add this media content item to the feed. The New RSS Media Content screen is shown in figure 1.4:
Figure 1.4: New RSS Media Content window
Once added to the feed, media items will appear on the Edit RSS Item screen, as shown in figure 1.5. Media content can be edited by clicking the media item link. Clicking on the trash can icon will remove a media item.
Figure 1.5: Media Content Items
Publishing the page associated with your RSS item will push your item out to the live feed.
1.2 Applications of Media RSS
Media RSS complements the RSS 2.0 specification, allowing the attachment of media items to a feed without the need to place these items inside the RSS description. An advantage to using Media RSS, as opposed to using regular RSS 2.0, is the separation of content; the RSS description remains clean, and users are directed to visit your website in order to view media content. Some feed readers even have the ability to view information about the media content within the reader itself; however, support for this functionality is not universal and should never be relied upon.
Media RSS is compatible with any media content, so long as that content may be reached from a valid URL. This includes the following media types:
- Flash
- DIVX
- Quicktime
- Windows Media
- Real Player
- WAV
- MP3
- And more….
Other file types may also be added as media content. This includes Image files, PDF files, MS Word documents, and webpages.
2. Media RSS XML
This section describes the XML implementation of Media RSS, including the Media namespace and XML tagging structure.
2.1 Media Namespace
Media RSS implements the Yahoo Media RSS (MRSS) specification. Yahoo Media RSS uses the “media” namespace; this namespace must be declared in the RSS XML file before using Media RSS. Declaring this namespace is as easy as adding the following to the root-level RSS tag:
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
Figure 2.1: Media RSS Namespace Declaration
OU Campus builds the RSS XML file using the feed templates supplied in the OMNI-INF folder on the staging server. This folder is not accessible from within the OU file manager. An FTP connection to the staging server is required to access these files. RSS templates typically reside in the /OMNI-INF/feeds directory.
2.2 XML Tagging Structure
RSS Items can have an unlimited number of media content items. Each media content item is specified by a single <media:content> tag, which encapsulates the information about that item. A URL to the media file is specified in the <media:content> url attribute. The <media:content> tag has four children: <media:title>, <media:description>, <media:thumbnail>, and <media:keywords>. An example Media RSS item is shown below:
<media:content url="http://gallenauniversity.com/img/computer.jpg"> <media:title>New Library Computers</media:title> <media:description>Gallena University’s library welcomes new computer equipment this semester, just in time for the beginning of the new school year.</media:description> <media:thumbnail url="http://gallenauniversity.com/img/computer_icon.jpg"> </media:thumbnail> <media:keywords>computers, education, library</media:keywords> </media:content>
Figure 2.2: Media RSS Item, Example XML
Awareness of this XML tagging structure is useful for designing a script to display the feed content on a webpage. These RSS reader scripts may be written in a variety of web languages, including the following: PHP, ASP, JSP, and XSL.
The following code block, shown below, demonstrates a complete RSS XML file. Observe the location of the RSS namespace declaration and Media RSS Item:
<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet title="XSL_formatting" type="text/xsl" href="/_resources/rss/news.xsl"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <title>Example Media RSS</title> <link>http://www.gallenauniversity.com/</link> <description>This is an example Media RSS file.</description> <language>en-us</language> <lastBuildDate>Wed, 9 Sep 2009 09:49:22 -0700</lastBuildDate> <docs>http://blogs.law.harvard.edu/tech/rss</docs> <generator>OmniUpdate (OU Publish)</generator> <item> <title>Gallena University Celebrates 50th Anniversary</title> <link>http://www.gallenauniversity.com/about/index.html</link> <description>"The 50th anniversary celebration was excellent," explains college president Dan Smith." Our university has aged well." Gallena University services 15,000 students in a diverse variety of majors.</description> <author>Andrew Huard <ahuard@omniupdate.com></author> <pubDate>Tue, 8 Sep 2009 10:02:47 -0700</pubDate> <media:content url="http://www.gallenauniversity.com/50th.mov"> <media:title>50th Anniversary Celebration</media:title> <media:description>Gallena University celebrates its 50th Anniversary</media:description> <media:thumbnail url="http://www.gallenauniversity.com/50th.jpg"> </media:thumbnail> <media:keywords>anniversary, university, celebration</media:keywords> </media:content> </item> </channel> </rss>
Figure 2.3: Complete Example RSS XML File
3. Template Control File (TCF) Implementation
RSS Feeds are easy to manage using OU Templates! Template control files (TCF) allow website administrators to generate custom feed creation forms for their users. TCFs even have the added advantage of creating a new page and RSS item in a single step.
This section provides supplemental material on implementing Media RSS in a TCF. For more information on Template Control Files, view our TCF documentation.
3.1 TCF Variables
TCF <variable> fields can be accessed from within <template> attributes by using curly-bracket notation. For example, to set the RSS title to the value of the variable named “title”, the following RSS-title attribute statement might be used:
RSS-title=”Gallena University – {title}”
Figure 3.1: RSS-title <template> attribute, calling a TCF variable using curly-bracket notation
3.2 RSS-Media Template Attribute
Media RSS can be seamlessly implemented in a template control file using the template rss-media attribute. All five of the following RSS-media fields must be implemented, in the following order:
- Title
- File URL
- Description
- Thumbnail
- Keywords
A special notation is used to separate each of these fields in the rss-media attribute. Media items are separated by double-bar (||), and media fields are separated by double-het (^^). Using this notation, an unlimited number of Media RSS items can be attached to an RSS item. The values inside the curly brackets are TCF variable names.
rss-media="{mtitle1}^^{murl1}^^{mdesc1}^^{mthumbnail1}^^{mkeywords1}||
{mtitle2}^^{murl2}^^{mdesc2}^^{mthumbnail2}^^{mkeywords2}||
{mtitle3}^^{murl3}^^{mdesc3}^^{mthumbnail3}^^{mkeywords3}"
Figure 3.2: RSS-title <template> attribute, calling a TCF variable using curly-bracket notation