RSS

From BC$ MobileTV Wiki
Jump to: navigation, search
RSS logo

Really Simple Syndication (commonly abbreviated RSS; also referred to as RDF-based Syndication Standard, or, Real-time Streaming Syndication format, among other monikers) is a standard for representing live and constantly updating information on the web, so that it may be easily indexed and read by Feed Reader applications.

This is only possible through standardization of formats, and permissive Readers that do not fail when errors or inconsistencies are encountered.


RSS specifications timeline


Specifications

Modules


RSS 2.0 syntax

 <?xml version="1.0" encoding="UTF-8"?>
 <rss version="2.0">
   <channel>
     <title>SoftArea51 - latest XML & CSS Utilities software for Windows</title>
     <link>http://www.softarea51.com/windows/Web_Development/XML_CSS_Utilities/LatestReleases-1.html</link>
     <description>Try and buy latest XML & CSS Utilities software for Windows</description>
     <language>en-us</language>
     <image>
       <title>SoftArea51 - latest XML & CSS Utilities software for Windows</title>
       <url>http://www.softarea51.com/images/logo.gif</url>
       <link>http://www.softarea51.com/</link>
       <description>Try and buy latest XML & CSS Utilities software for Windows</description>
     </image>
     <item>
       <title>Feed Mix</title>
       <link>http://www.softarea51.com/windows/Web_Development/XML_CSS_Utilities/Review-Feed_Mix.html</link>
       <description>Feed Mix is an RSS editor with the unique ability to create a new RSS feed from several others</description>
     </item>		
   </channel>
 </rss>

RSS .vs. Atom Comparison

The following table compares RSS .vs. Atom elements:

RSS 2.0 Atom 1.0 Comments
rss - Vestigial in RSS
channel feed
title title
link link Atom defines an extensible family of rel values
description subtitle
language - Atom uses standard xml:lang attribute
copyright rights
webMaster -
managingEditor author or contributor
pubDate published (in entry) Atom has no feed-level equivalent
lastBuildDate (in channel) updated RSS has no item-level equivalent
category category
generator generator
docs -
cloud -
ttl - <ttl> is problematic, prefer HTTP 1.1 cache control
image logo Atom recommends 2:1 aspect ratio
- icon As in favicon.ico
rating -
textInput -
3skipHours -
skipDays -
item entry
title title
author author
- contributor
description summary and/or content depending on whether full content is provided
comments -
enclosure - rel="enclosure" on <link> in Atom
guid id
- published
- updated
source - rel="via" on <link> in Atom
- source Container for feed-level metadata to support aggregation

[3]


PubSubHubbub

PubSubHubbub is a simple, open, web-hook-based pubsub protocol & open source reference implementation particularly well-suited for blog updates and Social Network activity streams.

For RSS 2.0, PubSubHubBub requires the use of RSS extensions and is accomplished by adding an Atom link element:

 <?xml version="1.0"?>
 <rss xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
       <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>
       <item>
       ...
       </item>
    </channel>
 </rss>

[4] [5]

PubSubHubbub works natively in ATOM by adding a simple <link> tag as follows:

  <?xml version="1.0" encoding="utf-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
    <title>Example Feed</title>
    <subtitle>A subtitle.</subtitle>
    <link href="http://example.org/feed/" rel="self" />
    <link href="http://example.org/" />
    '''<link rel="hub" href="http://somehub.com/http://example.org" />'''
    <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
    <updated>2003-12-13T18:30:02Z</updated>
    <author>
      <name>John Doe</name>
      <email>johndoe@example.com</email>
    </author>
    <entry>
    ...
    </entry> 
  </feed>

[6]



RSScloud

RSScloud is a client-server system supporting the idea that instantaneous updates are the next big step in web technologies. RSScloud [7][8] There are three sides to the RSScloud:

  1. The authoring tool. I edit and update a feed. It contains a <cloud> element that says how a subscriber should request to notification of updates.
  2. The cloud. It is notified of an update, and then in turn notifies all subscribers.
  3. The subscriber. A feed reader, aggregator, person checking the feed through browser's feed parser, whatever -- that subscribes to feeds that may or may not be part of a cloud.

And it looks like the following entry (appearing inside a <channel> element):

 <cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.Notify" protocol="xml-rpc" />

[9]

IE Issue

You may notice, when trying to view a majority of RSS feeds within your browser, that an error message occurs, rather than a tree or list-based representation of the RSS Feed. This is widely known as the IE7 "Billion Laughs" RSS issue.

According to Microsoft's development team, this was a precautionary measure to prevent Distributed Denial-of-Servics (DDOS) attacks through an exploit available in the basic XML protocol, through "faking" the underlying DTD structure. There are a few possible solutions (and one official solution) for getting around this issue.[10]


Autodiscovery

Autodiscovery enables an automated script, bot, search engine or feed reader to visit a site address (for instance http://bcmoney.tv) and "discover", in other words implicitly generate a link to the RSS feed (for instance http://bcmoney-mobiletv.com/rss/new/) for the purpose of integrating the feed's data to an internal database, displaying its data, perfomring aggregation tasks, re-syndication, or other uses within the site's terms of use.

EXAMPLES

FEED SOURCES

Dragable RSS Boxes

Dragable RSS Boxes is an excellent script and fully-featured RSS Reader/Parser solution available at DHTML Goodies. It is one of the best interfaces from which to work with RSS.

Feed FINDER

This class can be used to extract the URLs of RSS and ATOM feeds associated to a page, as well as OPML outline documents. It retrieves a given page (using cURL) and parses its head section to obtain the list links to the associated RSS, ATOM and OPML links. The URLs of the available links are returned in an array, if any. Before attempting to retrieve the specified page, the class checks the site's robots.txt file first to see if it is allowed to parse the site pages.

The excellent FeedFinder class from PHPclasses is running live on BCmoney MobileTV at the address below:

http://bcmoney-mobiletv.com/mrss/findfeeds/?l=http://www.bcmoney-mobiletv.com

It will be used to populate a list of useful/relevant RSS feeds in existence on the world-wide web. (Most likely cross-referenced with the DMOZ website directory, which has a raw RDF Data Dump available.)


Feed Finder (ATOM)

This separate feed finder class can be used to check whether an URL is of an RSS or Atom feed. It retrieves the contents of a Web resource given its URL. The class tries to parse the retrieved content assuming it is a XML document. It checks whether certain XML elements are present to determine whether it is a feed in RSS 1, RSS 2 or Atom formats. The class can get feeds from an OPML file.





Tools

Feed Readers

The Feed Reader is a core element of processing and presenting RSS feeds in a simple, intuitive format (typically as a list or other collection of links).

[13]


RSS Parser

JAVA

JavaScript

XSLT

Python

PHP

 <?php
	$doc = new DOMDocument();
	$doc->load('http://www.softarea51.com/rss/windows/Web_Development/XML_CSS_Utilities.xml');

	$arrFeeds = array();
	foreach ($doc->getElementsByTagName('item') as $node) {
		$itemRSS = array ( 
			'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
			'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
			'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
			'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
			);
		array_push($arrFeeds, $itemRSS);
	}
 ?>

[16]


Resources


Tutorials


External Links


References

  1. Extending RSS 2.0 With Namespaces: http://www.disobey.com/detergent/2002/extendingrss2/
  2. How to extend RSS 2.0: http://www.reallysimplesyndication.com/howToExtendRss
  3. RSS 2. 0 and Atom 1.0 Compared: http://www.intertwingly.net/wiki/pie/Rss20AndAtom10Compared#table
  4. PubSubHubbub -- RSS Feeds: http://code.google.com/p/pubsubhubbub/wiki/RssFeeds
  5. Google Reader Speeds Up Sharing With PubSubHubbub: http://www.techcrunch.com/2009/08/05/google-reader-speeds-up-sharing-with-pubsubhubbub/
  6. Comparison of PubSubHubbub to light-pinging protocols": http://code.google.com/p/pubsubhubbub/wiki/ComparingProtocols
  7. SOAP Meets RSS: http://cyber.law.harvard.edu/rss/soapMeetsRss.html
  8. SOAP meets RSS with new CLOUD tag: http://www.thetwowayweb.com/soapmeetsrss
  9. Example RSS 2.0 feed with CLOUD entity: http://radio.weblogs.com/0001015/rss.xml
  10. Microsoft Publisher's Guide on working with IE-compatible RSS Feeds: http://blogs.msdn.com/rssteam/articles/PublishersGuide.aspx
  11. Sitemap: http://www.canada.com/aboutus/sitemap.html
  12. Mapped up dynamic World Map - World News RSS feed reader: http://3spots.blogspot.com/2006/08/mapped-up-dynamic-map-rss-feed-reader.html
  13. TechCrunch - State of Online Feed Readers: http://www.techcrunch.com/2006/03/30/the-state-of-online-feed-readers/
  14. ROME in a Day -- Parse & Publish Feeds in Java: http://www.xml.com/pub/a/2006/02/22/rome-parse-publish-rss-atom-feeds-java.html
  15. Manage RSS feeds with the Rome API: https://www.javaworld.com/article/2077795/java-se/manage-rss-feeds-with-the-rome-api.html?page=3
  16. Parse RSS with PHP: http://www.softarea51.com/tutorials/parse_rss_with_php.html
  17. REST / Using feeds to publish events: https://www.mscharhag.com/api-design/rest-event-feed
  18. Here's Why Google and Facebook Might Completely Disappear in the Next 5 Years: http://www.forbes.com/sites/ericjackson/2012/04/30/heres-why-google-and-facebook-might-completely-disappear-in-the-next-5-years/2/
  19. Google and Facebook Dead in 5 Years? Fat Chance!: http://www.forbes.com/sites/georgeanders/2012/05/02/lift-that-curse-mobile-wont-kill-google-or-facebook/

See Also

mRSS | Atom | RDF | News | Podcast | OPML