Skip to content

Instantly share code, notes, and snippets.

@cmbaughman
Created March 5, 2014 16:02
Show Gist options
  • Select an option

  • Save cmbaughman/9370106 to your computer and use it in GitHub Desktop.

Select an option

Save cmbaughman/9370106 to your computer and use it in GitHub Desktop.

Revisions

  1. cmbaughman created this gist Mar 5, 2014.
    17 changes: 17 additions & 0 deletions GetRSSFeed.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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);
    });