Question

How to read RSS Feed by using Java Script.

As I am Android developer I am very new In Java Script I have basic knowledge That's why I have not tried any thing.

I just want to know is this possible to do by javascript if yes then any one please give me the basic idea so that I will start.

Below is my code that I have tried. But it is not working.

function latestQuaterly()
{
 alert("Onclick Event is occur");
 com.myjavatools.xml.Rss rss = new com.myjavatools.xml.Rss(new java.net.URL("http://219.64.5.9/androidwebservice/RssFeed.aspx?linkname=annualreport";)); 
 int increment = 0; 
 for (java.util.Iterator i = rss.getItems().iterator(); i.hasNext();)
  { 
    if (increment > 1) { 
        break; 
        } 
        increment++; 
        com.myjavatools.xml.Rss.Item item = (com.myjavatools.xml.Rss.Item) i.next();
   }
   alert("count is :"+increment);
 }

In side the the RSS feed their is Title, Description and link I want to retrieve that separately .

Was it helpful?

Solution

if you want to do it in jsp file, you can write java code inside scriptlet tag and use the java rss library ----http://www.myjavatools.com/projects/v.1.4.2/xml/doc/com/myjavatools/xml/Rss.html

The library provide methods to read all feeds from the given url and supported methods to display each feed seperately.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top