Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 403525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:13:29+00:00 2026-05-12T17:13:29+00:00

I would like to use the Google AJAX Feed API to fetch multiple newsfeeds

  • 0

I would like to use the Google AJAX Feed API to fetch multiple newsfeeds and display them on a webpage.

I can’t use Google’s FeedControl class because I want to control the way the items of the feed are displayed. That leaves me with Google’s Feed class as the only option.

I’ve got it to work with a single feed: provide a url and a callback function; process the results of the feed inside the callback function.

My question: How do i fetch multiple feeds? I would somehow have to make a new google.feeds.feed object inside the callback function and provide it with a new url and … the same callback-function (?)

I never studied computer sciences, so this kind of recursion makes my head spin.
Anyone can explain what I have to do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:13:29+00:00Added an answer on May 12, 2026 at 5:13 pm

    Sure, you can do it that way, here’s some pseudocode:

    // 'feeds' is an array of the feed URLs
    function grabFeeds(feeds) {
        var index;
    
        // We start with the first feed
        index = 0;
    
        // Kick off the process
        feedWorker();
    
        // Our "go get the next feed" function
        function feedWorker() {
            var feed;
    
            // Do we have any more?
            if (index < feeds.length) {
                // Yes, request it and bump our index
                // (You could combine these lines, but it's
                // clearer to keep them separate)
                feed = feeds[index];
                ++index;
                start_feed_download(feed, callback);
            }
        }
    
        // Our callback function
        function callback() {
            // ...do something with the result...
    
            // Kick of the next feed (feedWorker is defensive,
            // so we don't have to check index here)
            feedWorker();
        }
    }
    

    I don’t know the Google Feed API, hence the placeholder start_feed_download function.

    What that does is start the process of grabbing the feeds via the grabFeeds function, which accepts an array of feeds. grabFeeds kicks off feedWorker, which initiates the first feed request, and then returns immediately (almost certainly before the first feed is retrieved). callback processes the result, then asks feedWorker to kick off the next feed request (if there is one).

    The “magic” here is that feedWorker and callback are both closures, so even though grabFeeds has already returned, the index and feeds variables live on (in an object called an “execution context”) for as long as anything references the things inside the execution context — in our case, until callback and feedWorker are no longer referenced by Google’s stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use a language that I am familiar with - Java,
I would like to use something like CLR Profiles on .Net 2.0 to see
I would like to use as and is as members of an enumeration. I
I would like to use a component that exposes the datasource property, but instead
I would like to use client-side Javascript to perform a DNS lookup (hostname to
I would like to use javascript to develop general-purpose GUI applications. Initially these are
I would like to use my laptop as a web development (PHP, Python, etc.)
I would like to use Emacs to edit some VB6 files but Emacs does
I would like to use VB9 but am not sure what syntax to use
I would like to use databinding when displaying data in a TextBox. I'm basically

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.