Why and how to create media rss feeds
From Transmission
Aim: Automatically informing other websites when you have added new video information to your online database
Task : How to create a Media RSS feed with various tools
Tools: an online database, network of other (potentially) interested online databases
Why create Media Rss feeds
RSS is Really Simple Syndication - a standard format used by websites to package information for other websites to suck in updated information on a regular basis. Where information is packaged in the same way by a group of websites using RSS, simple reader software can show information from a number of websites in the same list or database. At the moment RSS is used mainly by news websites and blogs, but it's becoming increasingly common for other information types, including video.
"As TV moves online, we have a chance to make a system that's more open and democratic than ever. There's no reason that internet TV should continue to be controlled by a small number of corporations. We can do a lot better. A video RSS feed gives you the freedom to use any video hosting setup and gives your viewers the freedom to watch your videos from any video RSS reader.... The beauty of an open standard like video RSS is that you make it once and it works with any feed reader. Any feed that works in iTunes (a "video podcast") will also work in Miro and other RSS players."
The Transmission Network is developing video [http://www.icbl.hw.ac.uk/perx/advocacy/exposingmetadata.htm metadata standards - to make video RSS and Atom feeds much more effective, parsable and searchable, enabling users of each video publisher to generate new RSS feeds on a subject of relevance to them/their website, which may then aggregate those feeds and display searches of their contents as new feeds, along with others of interest, and so on... Once we get started, the possibilities are endless!
So, what we want you to do now is to create RSS feeds of your video information.
How to create a Media rss feed
You may use a video upload system that automatically creates a Media RSS feed for you. For example the Video and Audio modules of Drupal do this. Or a system like engage media, ifiwatch.tv or clearerchannel. But it may be that you already have a database system for information on your videos that does not automatically produce RSS, so the best short term solution is to write an extra bit of code to create a Media RSS feed. This really shouldn't be too difficult technically for someone who knows that they are doing - maybe half a day's work.
If you are asking: "can I easily create a Media RSS feed?" Then the answer is yes - if you have, in a web database, details of the URL of the downloadable video, and preferably also information about its length, filesize etc as well as title, date, auther etc. If not, you'll have to enter that information somehow, ie create new fields in your database, and that might get more complicated.
For the resources to create a valid Media RSS you may as well go straight to the Yahoo Media RSS specification. http://search.yahoo.com/mrss
If this is getting really confusing then you should probably just look at the examples. If you copy one of the examples given on the specifications, shown in the example below, then you will get the required results without making your brain ache hugely.
Media Rss feed using a Creative Commons license.
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"> <channel> <title>My Movie Review Site</title> <link>http://www.foo.com</link> <description>I review movies.</description> <item> <title>Movie Title: Is this a good movie?</title> <link>http://www.foo.com/item1.htm</link> <media:content url="http://www.foo.com/trailer.mov" fileSize="12216320" type="video/quicktime" expression="sample"/> <creativeCommons:license> http://www.creativecommons.org/licenses/by-nc/1.0 </creativeCommons:license> <media:rating>nonadult</media:rating> </item> </channel> </rss>
It is really a matter of creating a text file with the right format of data. This rss file will include details of the location of your downloadable video.
So while it is possible to write a RSS file by hand, in a word processing program and put it online, it is more likely to pull that information out of a database.
Most online databases are written in Mysql or similar so here is an example of how to create a feed with mysql and php. You will need to change the name of of the fields to suit your database. This code is a very general guide! Please don't attempt to copy it directly. Use a php resource like http://phpbuilder.com for troubleshooting.
$filepointer_temp = "../example.rss";
$filepointer = fopen("$filepointer_temp", "w");
fputs ($filepointer, "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
<rss version=\"2.0\">
<channel>
<title>$title_full</title>\r
<copyright>Creative Commons</copyright>\r
<link>$link_home</link>\r
<description>$description</description>\r
<language>en-uk</language>\r
<image>\r
<link>$link_home</link>\r
<title>$title_full</title>\r
<url>$image</url>\r
<height>90</height>\r
<width>120</width>\r
</image>\r
");
$sql_fieldvals = "Select $field_name_list from $table_name
order by id desc limit 0, 15";
$sql_result= mysql_query($sql_fieldvals, $connection)
or die ("couldn't execute field values query");
$idz ="0";
while ($row = mysql_fetch_array($sql_result))
{
for ($idz =0; $idz < $numrows; $idz++)
{
$rssfield_value_arr[$rss_field_as[$idz]] = $row[$idz];
$rssfield_value_arr[$rss_field_as[$idz]]=strip_tags($rssfield_value_arr[$rss_field_as[$idz]]);
<item>\r
<title>$rssfield_value_arr[name]</title>\r
<description>$rssfield_value_arr[shortdescription]</description>\r
<link>$base_url/$iona/page.php?id=$rssfield_value_arr[id]&prefix=$prefix</link>\r
<media:thumbnail url=\"$rssfield_value_arr[publisher_logo]\" />\r
<guid isPermaLink=\"false\"> $rssfield_value_arr[id] $file_download</guid>\r
<media:group>\r
");
fputs ($filepointer, "
<media:content url=\"$file_download\" fileSize=\"$file_filesizebytes\" type=\"$file_mimetype\" expression=\"full\">
<media:rating>nonadult</media:rating>
</media:content>
");
}
fputs ($filepointer, "
</media:group>
</item>\r
");
}
fputs ($filepointer, "</channel>
</rss>
");
Testing your media rss feed
To test it you should use the Miro application http://getmiro.com
This is a player that incorporates media rss feeds. Basically if it works in there you should be ok.
To add your RSS as a Channel on Miro Just click on Add Channel and put in the location of you RSS feed.
This resource is also helpful in testing the details of your feed http://feedvalidator.org

