1. Atsushi Odagiri
  2. wave gadgets

Source

wave gadgets / feedgadget.xml

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Feed Gadget" >
</ModulePrefs>
<Content type="html"><![CDATA[
    <div>
      <span id="feed-title"></span>
      <ul id="feed-entries">
      </ul>
    </div>
    <script>
    var url = 'http://feeds.feedburner.jp/AodagBlog';
    function callback(obj) {
      var feed = obj.data;
      var title = document.getElementById('feed-title');
      title.appendChild(document.createTextNode(feed.Title + '(' + feed.Entry.length + ')'));
      for (var i=0; i < feed.Entry.length; i++) {
        var e = feed.Entry[i];
        var li = document.createElement('li');
        var anchor = document.createElement('a');
        anchor.setAttribute('href', e.Link);
        anchor.appendChild(document.createTextNode(e.Title));
        li.appendChild(anchor);
        document.getElementById('feed-entries').appendChild(li);
      }
    }

    function init() {
      var params = {};
      params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
      var req = gadgets.io.makeRequest(url, callback, params);
    }
    gadgets.util.registerOnLoadHandler(init);
    </script>
]]></Content>
</Module>