I just wanted to add to this also that if you are wanting real time you may also want to consider just using Twitters API, instead of querying Google and they send a fetcher to fetch and cache the data and return it to you, it would make sense that it would provide less latency to just fetch it from the source using their APIs. Twitter also provides a few types of data (like JSON/JSONP) you can request also depending on your preferred method.
If I remember correctly (off the top of my head), you can also request their data (check the type) in batches of 100 results per request also. http://apiwiki.twitter.com/ http://apiwiki.twitter.com/Getting-Started Cheers! Vision Jinx On Jan 26, 11:18 am, bdlang <[email protected]> wrote: > Hey, new to the feeds API, testing out a couple of RSS feeds with it. > I had the Digg feed example working fine, also tested a couple of > others and was trying to use setInterval to reload the feed every N > seconds. > > Is there a limiter in place that enforces how many entries can be > updated? I was tinkering with the twitter public feed, but it > consistently keeps the same few entries and never updates. I was > trying to be smart and use a caching mechanism so only new feeds would > update the view, but perhaps this is my downfall. If I reload the RSS > feed manually, I can see new public tweets everytime I refresh the > browser, so I know there is activity (unlike Digg or another site > where there might be a new entry once every 10 minutes). > > Here's the test page > URL:http://test.somedomain.us/google/ajax/feeds/twitter.html > > Here's the JS involved: > > google.load("feeds", "1"); > > var cache= {}; > > var addContent= function(data){ > var div= document.createElement("div"); > div.appendChild( document.createTextNode( data.title ) ); > document.getElementById("content").appendChild(div); > }; > > function feedcallback(result){ > if (window.console) console.log('trigger callback'); > var contentDiv= document.getElementById("content"); > contentDiv.innerHTML='<strong>Latest Tweets</strong>'; > if ( result.error ) { > console.log(result.error); > } else { > for (var i=0,l=result.feed.entries.length; i<l; i++){ > var thisEntry= result.feed.entries[i]; > > var thisCacheable= thisEntry.link; > if ( !cache[thisCacheable] ) { > if (window.console) > console.log('adding ['+ thisCacheable +'] to the > cache'); > cache[thisCacheable]= thisEntry; > } > addContent(cache[thisCacheable]); > } > } > }; > > function initialize(){ > var feed= new google.feeds.Feed("http://twitter.com/ > statuses/public_timeline.rss"); > feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT); > feed.setNumEntries(10); > feed.load(feedcallback); > > var timer= setInterval(function(){ > feed.load(feedcallback); > },1000 * 60); > }; > > google.setOnLoadCallback(initialize); -- You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
