TechVideos
  Home     About           Free Videos           FAQ     Contact  
Stay Informed Tell A Friend Bookmark this site
Copyright 2005

CREATING AND READING RSS NEWSFEEDS


INTRODUCTION

Really Simple Syndication (RSS) is a standardized XML format designed for syndicating and aggregating Web content. Using RSS, an organization or business can create data feeds that disseminate news, schedules, software updates, sport scores, weather reports, movie listings, and much more. Once the information is posted, RSS aggregators can grab the latest newsfeeds and present the information to the user in an instantly updatable and customizable view. Before RSS, a user would typically bookmark their favorite sites. Then as time permitted, they would painstaking visit each bookmarked site seeing if there was any current, relevant information posted. However, with RSS, the user can have the content from numerous sites delivered to one place where it is automatically updated, saving precious time. Furthermore, RSS newsfeeds typically provide the user with site summarizes, without advertisements, distracting graphics, and other extraneous information.

My contributions to this area - I have created a script that takes numerous RSS newsfeeds and displays them in a single document in three column format as illustrated in Figure 4.

RSS AGGREGATORS

Figure 1 illustrates how an RSS Aggregator collects information. First the latest stories and articles are published on the web. Then the latest headlines from the site are packaged into an RSS newsfeed. Next the RSS aggregator goes out to the user's favorite sites and grabs the latest newsfeeds containing the latest headlines. Finally, the headlines are presented to the user in an instantly updatable and customizable view.


Figure 1: Shows how an RSS aggregator collects information.

RSS NEWSFEEDS

Finding RSS newsfeeds is fairly easy. You can enter key terms like "RSS" and topics you are interested in into your favorite search engine. Another approach is to use an RSS directory to find relevant newsfeeds. One such RSS directory can be found at http://www.blinkbits.com. BlinkBits has newsfeeds on thousands of topics and currently estimates there are 11.2 million updated sources. Another website called http://www.syndic8.com also provides a directory of all syndicated news headlines. Other RSS newsfeeds can be found at websites such Yahoo, WebMD, and ESPN. Yahoo currently has 18 newsfeeds, WebMD has 32 newsfeeds, and ESPN has 10 newsfeeds. These websites and their various newsfeeds are listed below.

Yahoo! News
  Top Stories
Asian Tsunami Disaster
Politics
Technology
Entertainment
Science
  U.S. National
Iraq
Elections
Sept. 11 & Terrorism
Health
Opinion/Editorial
  World
Mideast Conflict
Business
Sports
Oddly Enough
Obituaries

WebMD
  Allergy & Clinical
Immunology
Business of Medicine
Cardiac Rhythm Management
Cardiology
Critical Care
Dermatology
Diabetes & Endocrinology
Family Medicine/Primary Care
Gastroenterology
General Surgery
HIV/AIDS
Hematology-Oncology
Infectious Diseases
Internal Medicine
Med Students
Medscape Today
  Nephrology
Neurology & Neurosurgery
Nursing
Ob/Gyn & Women's Health
Ophthalmology
Orthopaedics
Pathology & Lab Medicine
Pediatrics
Pharmacists
Psychiatry & Mental Health
Public Health & Prevention
Pulmonary Medicine
Radiology
Rheumatology
Transplantation
Urology

ESPN
  Top Headlines
NFL Headlines
NBA Headlines
MLB Headlines
  NHL Headlines
Autos Headlines
Soccer Headlines
  College Basketball Headlines
College Football Headlines
Olympic Sports Headlines

INTEGRATING AN RSS NEWSFEED INTO A DOCUMENT

One of the main benefits of RSS technology is that it allows Web sites to automatically add updated web content to a page. Figure 2 shows how a single RSS newsfeed has been incorporated into a document. Using this approach the site appears to be constantly updated. However, in reality this site is simply grabbing the latest updated information on the Yahoo News RSS site and including it in the document.

Most RSS newsfeeds specify terms of use. Typically the newsfeeds are free of charge for individuals, non-profit organizations, and for non-commercial uses. Some RSS publishers require permission prior to making use of their feeds for commercial purposes. Regardless, some RSS newsfeeds ask that you provide attribution in connection with your use of the feeds. For example, at Yahoo they ask that you either display the text "Yahoo! News" or their graphic logo.


Figure 2: Shows how an RSS newsfeed has been included into a document.

RSS NEWS READERS

RSS newsfeeds are can be read using a news aggregator. These are standalone applications that download and display RSS newsfeeds. Figure 3 shows a newsfeed from Medscape being read in a news aggregator called "NewzCrawler". Other news readers include Amphetadesk, Bloglines, Feedreader, Google Reader, My Yahoo, and NetNewsWire. One drawback to these newreaders is that the software must be installed on the computer to read the newsfeed. This makes it more difficult to read news for people who use multiple machines.


Figure 3: Shows a screen capture of the newsfeed reader called Newz Crawler.

Another approach to reading RSS newsfeeds is to have the feed incorporated into a web document or "blogs". Figure 4 below shows how multiple RSS newsfeeds have been incorporated into a single document.


Figure 4: Show multiple newsfeeds being directed into a single document.

The main portion of the PHP source code to recreate this is shown below. Notice, that three arrays are created to specify the RSS newsfeeds. Next the three arrays are displayed into a table with three columns. In this example all three columns occupy 33% of the browser window.

  // List of RSS URLs 
  $rss_left = array( 
  'http://rss.news.yahoo.com/rss/topstories', 
  'http://www.medscape.com/cx/rssfeeds/news.xml', 
  ); 
  $rss_middle = array( 
  'http://www.oracle.com/technology/syndication/rss_otn_news.xml',
  'http://www.microsite.reuters.com/rss/technologyNews', 
  ); 
  $rss_right = array( 
  'http://www.infoworld.com/rss/news.rdf',
  'http://www.nytimes.com/services/xml/rss/userland/Home
  Page.xml', 
  ); 

  ...

  // Show all rss files 
  echo "<table cellpadding=\"5\" border=\"0\"><tr><td width=\"33%\" valign=\"top\">"; 
  foreach ($rss_left as $url) { 
    ShowOneRSS($url); 
  } 
  echo "</td><td width=\"33%\" valign=\"top\">"; 
  foreach ($rss_middle as $url) { 
    ShowOneRSS($url); 
  } 
  echo "</td><td width=\"33%\" valign=\"top\">"; 
  foreach ($rss_right as $url) { 
    ShowOneRSS($url); 
  } 
  echo "</td></tr></table>"; 
  
  ...

SECTIONS OF AN RSS FILE

You can build RSS newsfeeds to various specifications. However, most specifications include the following five sections: root, channel, image, item, and text input. The image and text input sections are typically optional. Once an RSS newsfeed has been created, it should be verified. One website that verifies RSS newsfeeds is http://www.feedvalidator.org.

Root Element.
The root element declares the document to be an XML file. It specifies the version of RSS and also includes the closing tag as shown in the listing below.

<?xml version="1.0">
<rss version="2.0"> 

</rss>

Channel Section.
The channel element describes the RSS feed. It describes what the channel is all about, who created the channel, what language the channel is written in, and a URL that points to the channel's source of information.

<channel>
  <title>NSU News and Announcements</title>
  <link>http://www.nsuok.edu</link>
  <description>The latest news from Northeastern State University</description>
  <language>en-us</language>
</channel>

Image Section.
The image section is an optional section that can be used to display a logo of the information provider. Here is an example of an image section.

<image>
  <title>NSU</title>
  <url>http://arapaho.nsuok.edu/~rosener/papers/rss/nsu.gif</url>
  <link>http://www.nsuok.edu</link>
  <width>400</width>
  <height>100</height>
</image>	

Item Section.
The item section is the most dynamic part of the RSS file. Typically the channel and image section identify the content provider and remain unchanged from day to day. Whereas in the item section, current headlines are change fairly frequently to give the website value. The listing below shows an example of two items.

<item> 
  <title> Open Spring Cources </title> 
  <link> http://www.nsuok.edu/schedules/openspring.html </link> 
  <description> Open classes for Spring 2005 </description> 
</item> 

<item> 
  <title> Press Releases </title> 
  <link> http://www.nsuok.edu/news </link> 
  <description> NSU News </description> 
</item> 

Text Input Section.
The text input element is optional. This section allows visitors to response to the RSS feed. Below is an example listing of a text input section.

<textinput>
  <title> Send </title>
  <description> Comments about NSU News and Announcements </description>
  <name>responseText</name>
  <link>http://www.cbt.nsuok.edu/contact/</link>
</textinput>

CONCLUSION

Really Simple Syndication (RSS) is a standardized XML format designed for syndicating and aggregating Web content. Using RSS, an organization or business can create data feeds that disseminate news, schedules, software updates, sport scores, weather reports, movie listings, and much more. Once the information is posted, RSS aggregators can grab the latest newsfeeds and present the information to the user in an instantly updatable and customizable view.


Powered by Sphider