views:

42

answers:

1

I want to extract the titles, images and text from any kind of Feed Rss ( feedburner, xml, etc ).

How can I do this with javascript ?

For example, I want to extract the stuff above from this feed:

http://feeds.mashable.com/Mashable

and from this feed:

http://casadipacheco.blogspot.com/feeds/posts/default

+2  A: 

Google feeds api: http://code.google.com/apis/ajaxfeeds/

google.load("feeds", "1");


    function initialize() {
      var feed = new google.feeds.Feed("http://feeds.mashable.com/Mashable?format=xml");
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            var div = document.createElement("div");
            div.appendChild(document.createTextNode(entry.title));
            container.appendChild(div);
          }
        }
      });
    }
    google.setOnLoadCallback(initialize);
Q_the_dreadlocked_ninja