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 706909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:13:06+00:00 2026-05-14T04:13:06+00:00

I have a simple web site ( http://www.kousenit.com/twitterfollowervalue ) that computes a quantity based

  • 0

I have a simple web site (http://www.kousenit.com/twitterfollowervalue) that computes a quantity based on a person’s Twitter followers. Since the Twitter API only returns followers 100 at a time, a complete process may involve lots of calls.

At the moment, I have an Ajax call to a method that runs the Twitter loop. The method looks like (Groovy):

def updateFollowers() {
    def slurper = new XmlSlurper()
    followers = []
    def next = -1
    while (next) {
        def url = "http://api.twitter.com/1/statuses/followers.xml?id=$id&cursor=$next"
        def response = slurper.parse(url)
        response.users.user.each { u ->
           followers << new TwitterUser(... process data ...)
        }
        next = response.next_cursor.toBigInteger()
    }
    return followers
}

This is invoked from a controller called renderTTFV.groovy. I call the controller via an Ajax call using the prototype library:

On my web page, in the header section (JavaScript):

function displayTTFV() {
    new Ajax.Updater('ttfv','renderTTFV.groovy', {});
}

and there’s a div in the body of the page that updates when the call is complete.

Everything is working, but the updateFollowers method can take a fair amount of time. Is there some way I could return a progress value? For example, I’d like to update the web page on every iteration. I know ahead of time how many iterations there will be. I just can’t figure out a way to update the page in the middle of that loop.

Any suggestions would be appreciated.

  • 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-14T04:13:07+00:00Added an answer on May 14, 2026 at 4:13 am

    For more-or-less-accurate progress reporting you have two alternatives:

    • Keep the server telling you its progress
    • Keep the client (browser) asking the server about its progress

    Keeping the server telling you the progress would be kind of easy to implement. You can, instead of calling the Ajax.Updater, create an iframe element and modify the server to, for each iteration, dump a response with some javascript to trigger showing the progress on the browser, and to flush that response. Like that, the browser will execute the javascript and keep waiting until the response finishes, so the user will see the progress indicator moving up until everything’s completed.

    Other approaches are available for the server to tell you about the operation’s progress. You can Bing/Google about Comet servers.

    As for getting the browser to periodically ask about the operation’s progress, you can either return some token to the browser for each iteration that the browser would check to see if it’s the final result or if it should pass it on to the server so the server keeps hitting twitter for the next result set, or somehow keep a state (if you have session state support, that might do it) in your server that is updated in each iteration and that can be polled on a separate request.

    I hope the suggestions help.

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

Sidebar

Related Questions

I have a simple PowerShell script that uses WMI to create a web site
I have a web site like this: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title></title> <link rel=stylesheet type=text/css
I am looking for a regex that validates simple website addresses, i.e. http://www.stackoverflow.com www.stackoverflow.com
Here's the setup. I have web site which is essentially a simple CMS. Here
I want to setup a simple site and I don't have any web development
I have integrated this menu in my website : http://www.htmldrive.net/items/demo/979/simple-google-style-Dropdown-menu-with-jQuery I want the menu
I am using the following sliding div script: http://www.webdesignerwall.com/demo/jquery/simple-slide-panel.html Currently, the slidetoggle function is
So, I have at site where I want pages such as; www.example.com/shop/index.php (or any
I'm using FancyBox jquery plugin to display modal popup boxes. The site is: http://www.chatisfying.com
I've got, what I would consider, a simple test web site. A single page

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.