I have written a webpage that takes in an xml file from an RSS and parses it by certain tags. I have tested it on a local copy of the data I am planning on using and it works fine. The catch is that I cannot figure out how to call an rss file on a different webpage and parse its data.
Here is my code for setting up the parser:
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET", ".../NewsFeed.aspx?output=Atom", false);
Here is the header of the xml file I get when I inspect the RSS page:
<?xml version="1.0" encoding="UTF-8" ?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
<title type="text"> News</title>
<subtitle type="text">A syndication of the most recently published news.</subtitle>
<id>uuid:64d61c8e-c5d7-4529-b5a3-2dcd4097238b;id=50</id>
<rights type="text">© 2013 <owner goes here>. All Rights Reserved.</rights>
<updated>2013-07-09T13:34:27Z</updated>
<link rel="alternate" href=".../Default.aspx" />
<link rel="self" href=".../NewsFeed.aspx" />
I edited the links for posting purposes. I have tried using both of the links listed in the RSS document as well as the URL to the external feed in the open xml method, but I had no luck.
xmlhttp.open("GET", "link goes here", false);
Does anyone know how I would read the RSS feed? As a side note, the feed is a standard RSS feed (2.0) returned in atom format.