|
|
|
|
|
|
|
|
|
|
|
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.
|
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 |
|
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 |
|
Top Headlines NFL Headlines NBA Headlines MLB Headlines |
NHL Headlines Autos Headlines Soccer Headlines |
College Basketball Headlines College Football Headlines Olympic Sports Headlines |
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.
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.
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>";
...
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> |