I am trying to parse an xml RSS feed (http://blog.counter-strike.net/index.php/feed/), currently I can get the content contained within <link>
and <description>
however I can't get <title>
because whenever I try to get it instead of giving me the blog title, I'm given the title for my own webpage.
The thing I find odd is that eventually if I keep refreshing the page the actual title of the blog appears. Not sure what causes this but ideally I'd prefer just to have the title of the blog and not of my own webpage.
I've looked at this question which helped me get started: parsing xml using jquery and ajax
Below is the code I have so far
$(document).ready(function () {
$.ajax({
url: 'http://cors.io/?u=http://blog.counter-strike.net/index.php/feed/',
type: 'GET',
dataType: "xml"
}).done(function(xml) {
$.each($("item", xml), function(i, e) {
$("#feed").append($(e).find("item title"));
$("#feed").append("<br />")
$("#feed").append($(e).find("description"));
$("#feed").append("<br />")
$("#feed").append($(e).find("link"));
$("#feed").append("<br />")
});
});
});
In addition to retrieving the title of the blog, I'd appreciate it if someone could tell me how to replace the likes of ’
which is shown within the description with what they're supposed to be.
Finally is it possible to retrieve and display images and videos from the RSS feed? It seems like they're contained within <content:encoded>
.