setNumEntries not working - not using a feed control

53 views
Skip to first unread message

monkey magix

unread,
Jul 5, 2009, 4:34:02 PM7/5/09
to Google AJAX APIs
I am not using the feed control as I want to output the feed results
and format the HTML myself however all I get is 4 entries no matter
which feed I try. I know this is the default value and have read about
setting setNumEntries to a higher value and also using
includeHistoricalEntries() to get round caching issues.

I have tried about 6 different feeds now and they all return 4
entries.

If it is a caching issue then is there a way to force a clearing of
the feed cache on the server?

A basic example of the code I am using is below:

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

function initialize() {
// just one of many feeds I have tried
//url = "http://feeds2.feedburner.com/StrictlySoftware"; //
another one with 44 entries showing 4
url = "http://www.skysports.com/rss/0,20514,11661,00.xml";
var feed = new google.feeds.Feed(url);
feed.setNumEntries = 20;
feed.includeHistoricalEntries();
for(var x in feed){
console.log(x + " = " + feed[x]);
}
feed.load(function(result) {
if (!result.error) {
// just trying this to see if it had any effect - no it
doesnt!
try{
result.feed.setNumEntries = 20;
result.feed.includeHistoricalEntries();
}catch(e){}

var container = document.getElementById("feed");
// always says 4 entries!!!
console.log("there are " +result.feed.entries.length + " entries");
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);

Am I doing something wrong here??

Thanks in advance for any help received.

Jeremy Geerdes

unread,
Jul 6, 2009, 11:22:00 AM7/6/09
to Google-AJAX...@googlegroups.com
Use feed.setNumEntries(20); instead of feed.setNumEntries = 20;

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
jgee...@mchsi.com

Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

monkey magix

unread,
Jul 6, 2009, 7:26:16 PM7/6/09
to Google AJAX APIs
LOL Numpty!!!

Thanks a lot. Blatant!!

On Jul 6, 4:22 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> Use feed.setNumEntries(20); instead of feed.setNumEntries = 20;
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> jgeer...@mchsi.com
>
> Unless otherwise noted, any price quotes contained within this  
> communication are given in US dollars.
>
> If you're in the Des Moines, IA, area, check out Debra Heights  
> Wesleyan Church!
>
> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com
Reply all
Reply to author
Forward
0 new messages