Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parse RSS feed as JSON from client using Google API
var rssUrl = "http://www.exploit-db.com/rss.xml";
function parseRSS(url, callback) {
$.ajax({
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url),
dataType: 'json',
success: function(data) {
callback(data.responseData.feed.entries);
}
});
}
html = "";
parseRSS(rssUrl, function(rss) {
for(i = rss.length-1; i >=0; i--) {
html += "<p><a href='" + rss[i].link + "'>" + rss[i].title + "</a></p>";
}
$("div#target").html(html);
});
@cmbaughman
Copy link
Author

cmbaughman commented Oct 12, 2018

That's awesome! Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment