How to write an RSS reader in AJAX

IBM Developers Works has a tutorial on how to build an RSS reader using AJAX. The amount of code you need to write is scary (and this is not the complete code). Adobe Flex 2 plus a simple Java programming to support DB interaction allows you to achive the same functionality using A LOT LESS coding.Just take a look at this screen:

The Flex 2 code below populates the bottom portion of the screen with financial news based on the selected stock on top ( (it does not work with a DB to store the RSS source so it’d add some 50 lines of Java code ). The data come from the Yahoo! Finance RSS feed. The URL looks as follows:
The suffix can be MSFT or whatever is selected on top is being passed to the code below.
Flex object is used through a proxy deployed under Tomcat or any other servlet container.
The entire application code and its description can be found in this article.

<mx:Panel xmlns:mx=""
title="News" width="100%" height="100%"�>
<mx:DataGrid id="newsGrid" width="100%" height="100%"
<mx:DataGridColumn headerText="Date"�dataField="pubDate" width="200"/>
<mx:DataGridColumn headerText="Title"�dataField="title"�wordWrap="true" />
<mx:DataGridColumn headerText="Description"�dataField="description"�wordWrap="true"�/>
<mx:DataGridColumn headerText="Link"�width="130">
<mx:LinkButton label="{}"�click="navigateToURL(new URLRequest(, '_blank')"/>

<mx:HTTPService id="newsFeed" useProxy="true"
resultFormat="e4x" fault="onFault(event)"�>

import mx.utils.ObjectProxy;
public function set security(value:String):void {
this.title = "News: " + value;

private function onFault(event:FaultEvent):void {
"Destination:" + event.currentTarget.destination + "n" +
"Fault code:" + event.fault.faultCode + "n" +
"Detail:" + event.fault.faultDetail, "News feed failure" );

[tags]Flex, Flex 2, RSS, AJAX[/tags]

One thought on “How to write an RSS reader in AJAX

  1. Hi All Experts,
    I want to use AJAX (Asynchronous JAVA script with XML ). How can i Optimize the site SEO.
    as Java script and flash is not recommended by search engines. Any suggestion or help is welcomed. With Regards.

Comments are closed.