Using Modules in Your RSS Feed - ICBM Module
(Page 4 of 4 )
This module, written by Matt Croydon and Kenneth Hunt, allows RSS feeds to state the geographical location of the origin of the feed or an individual item within it.
It's alleged that ICBM does actually stand for intercontinental ballistic missile, and certainly a half-arsed attempt at Googling for it produces only the explanation that describing one's position as an ICBM address is so that, should anyone wish, your data will allow the baddies to target you directly, presumably for being far too clever with your syndication feeds.
Either way, the namespace declaration is thus:
xmlns:icbm="http://postneo.com/icbm"
It contains two elements, usable in either the channel or the item context. The item context overrides the former, as you might expect.
icbm:latitude
This contains the latitude value as per the geographic standard WGS84:
<icbm:latitude>43.7628 </icbm:latitude>
icbm:longitude
This contains the longitude value as per the geographic standard WGS84.
<icbm:longitude>11.2442 </icbm:longitude>
That's my house, actually.
Go to http://www.postneo.com/icbm/ for more verbose details on the thinking behind the specification.
Yahoo!'s Media RSS Module
In December 2004, Yahoo! launched a beta video search engine at http://video.search.yahoo.com/. The original system spidered the Web looking for video files and indexed them with the implied information found in the filename and link text. To make it easier for video content producers to have Yahoo! index their sites, and to give the search engine much better data to play with, Yahoo! is now offering to regularly spider RSS feeds containing details of media files. This additional data is encoded in its new Media RSS Module.
That module consists of one element, <media:content>, with a namespace declaration of:
xmlns:media="http://tools.search.yahoo.com/ mrss/"
and four optional subelements. <media:content> is a subelement of item and consists of ten optional attributes.
url
url specifies the direct URL to the media object. It is an optional attribute. If a URL isn't included, a playerURL must be specified.
fileSize
The size, in bytes, of the media object. It is an optional attribute.
type
The standard MIME type of the object. It is an optional attribute.
playerURL
playerURL is the URL of the media player console. It is an optional attribute.
playerHeight
playerHeight is the height of the window the playerURL should be opened in. It is an optional attribute.
playerWidth
playerWidth is the width of the window the playerURL should be opened in. It is an optional attribute.
isDefault
isDefault determines if this is the default object that should be used for this element. It can be true or false. So, if an item contains more than one media:content element, setting this to true makes it the default. It's an optional attribute but can be used only once within each item.
expression
expression determines if the object is a sample or the full version of the object. It can be either sample or full. It is an optional attribute.
bitrate
The bit rate of the file, in kilobits per second. It is an optional attribute.
duration
The number of seconds the media plays, for audio and video. It is an optional attribute.
There are also four optional subelements to <media:content>, which can be also used as subelements to item:
<media:thumbnail>
Allows a particular image to be used as the representative image for the media object:
<media:thumbnail height="50" width="50">
http://www.foo.com/ keyframe.jpg</media:thumbnail>
It takes two optional attributes. height specifies the height of the thumbnail. width specifies the width of the thumbnail.
<media:categorty>
Allows a taxonomy to be set that gives an indication of the type of media content and its particular contents:
<media:category>music/artist name/album/song</media:category>
<media:category>television/series/
episode/episode number</media:categorty>
<media:people>
Lists the notable individuals or businesses and their contribution to the creation of the media object.
<media:people role="editor">Simon St Laurent</media:people>
role specifies the role individuals played. Examples include: producer, artist, news anchor, cast member, etc. It is an optional attribute.
<media:text>
Allows the inclusion of a text transcript, closed captioning, or lyrics of the media content:
<media:text>Oh, say, can you see, by the dawn's early light,</media:text>
Once your site has a feed working with the Media RSS Module, like that shown in Example 4-7, you can submit it to Yahoo! at http://tools.search.yahoo.com/mrss/ submit.html.
Example 4-7. media:content in action
<media:content url="http://www.example.com/movie.mov" fileSize="12345678" type=
"video/quicktime"
playerUrl="http://http:// www.example.com/player?id=1" playerHeight="200"
playerWidth="400"
isDefault="true" expression="full" bitrate="128" duration="185">
<media:thumbnail height="50" width="50">http://www.example.com/thumbnail.jpg
thumbnail></media:
<media:category>comedy/slapstick/ custard</media:category>
<media:people role="stuntman">Ben Hammersley</media:people>
<media:text>Take that! And that! And that!</media:text>
</media:content>
The development of your own modules is covered in Chapter 11.
Please check back next week for the conclusion to this article.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
|
This article is excerpted from chapter four of the book Developing Feeds with RSS and Atom, written by Ben Hammersley (O'Reilly; ISBN: 0596008813). Check it out today at your favorite bookstore. Buy this book now.
|
|