aym / google-ajax-apis

Automatically exported from code.google.com/p/google-ajax-apis
0 stars 0 forks source link

Feed entries are retrieved in weird order #536

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

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

    function feedLoaded(result) {
      if (!result.error) {
        var container = document.getElementById("content");
        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(i + ': ' + entry.title + '/' + entry.publishedDate));
          container.appendChild(div);
        }
      }
    }

    function feedLoadedNoHistory(result) {
      if (!result.error) {
        var container = document.getElementById("content");
        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(i + ': ' + entry.title + '/' + entry.publishedDate));
          container.appendChild(div);
        }
      }
    }

    function OnLoad() {
      var feedh = new google.feeds.Feed("http://simoncafe.blogspot.com/feeds/posts/default");
      feedh.includeHistoricalEntries();
      feedh.setNumEntries(4);
      feedh.load(feedLoaded);
      var feed = new google.feeds.Feed("http://simoncafe.blogspot.com/feeds/posts/default");
      feed.setNumEntries(4);
      feed.load(feedLoadedNoHistory);
    }

    google.setOnLoadCallback(OnLoad);

What is the expected output? What do you see instead?

    I expect `includeHistoricalEntries' wouldn't change the _first_ entry returned. In fact only with `includeHistoricalEntries' I can retrieve correct latest entry from this particular feed from the example.

What version of the product are you using? On what operating system?

    Feeds API version 1.0, Firefox 3.6.12, Windows XP.

Original issue reported on code.google.com by marcin.dabrowski on 30 Oct 2010 at 1:25