Creating an RSS Reader
(Page 1 of 4 )
Everyone who owns a website would have heard about the RSS phenomenon. Now you will get the opportunity to create your own RSS reader that will enable you to download and view RSS files on your desktop. This application will enable you to read RSS feeds from the Internet with the added advantage of being able to download XML files to your local hard drive.
A downloadable file for this article is available
here.
So, what is RSS all about?
Well, RSS is an acronym for Really Simple Syndication and is used for syndicating news and the content of news-like sites, including major news sites like Wired, Slashdot, and even personal weblogs. But it is not only used for news; it can be used for almost anything that can be divided up into smaller bits and pieces. For example if you have a web site, and want to share your latest research findings, then you’d make a summary of your findings and put it in a RSS file for others to see.
An RSS file is almost like an HTML page. It also uses tags to display content, but it does not have the same text formatting ability that HTML has. To do text formatting with RSS, you need to create what is called an XSL sheet, which basically transforms am XML document into an HTML document. Of course there are rules for how you write the contents of a RSS file. RSS content is written up in specific tags which are:
Title – Title of your story
Link – Link to your story
Description – Short description of your story
There are many other tags, such as date published, copyright, managing editor and so forth, but for now our primary content tags are the top three. Below is a example of a RSS document:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" rel="nofollow" target="_blank"
href="news.xsl"?>
<!-- Copy and paste the url into your newsreader application" -
->
<!-- generator="Movable Type/2.64" -->
<rss version="0.91">
<channel>
<item>
<title>RSS Syndication </title>
<link> http://www.linktothestory.com(Example Only) </link>
<description> Description of the story </description>
</item>
<item>
<title>Education in Crisis??</title>
<link> http://www.linktostrory.com </link>
<description>Description of the story</description>
</item>
</channel>
</rss>
The only downside to this is that you need to be on the Internet to view RSS file content; files are updated at various times. Some update every hour, and some update every other day. So you need to be connected in order to view the content. In our application we are partly going to address this "downside" by allowing users to actually download RSS files and read them at their leisure in addition to being able to read the contents of an RSS file while online. The program will store RSS links in a text file and will load them at start up. It will also give the user the ability to add new links that they discover on the Internet to the file.
What you need
Borland Delphi, any version, with TWebBrowser component.
Next: Code >>
More Delphi-Kylix Articles
More By Jacques Noah