Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created July 6, 2015 21:39
Show Gist options
  • Select an option

  • Save bahamas10/ae56468f78d39e00676f to your computer and use it in GitHub Desktop.

Select an option

Save bahamas10/ae56468f78d39e00676f to your computer and use it in GitHub Desktop.
example mike node
var i = 0;
function dosomething() {
http.get('/foo', function(res) {
// whatever you want
i += 20;
setTimeout(dosomething, 5 * 1000);
});
}
dosomething()
@bahamas10

Copy link
Copy Markdown
Author
var i = 0;
var increment = 20;
var numposts;

function dosomething() {
  http.get('/foo?offset=' + i, function(res) {
    // whatever you want

    i += increment;
    setTimeout(dosomething, 5 * 1000);
  });
}

blog.info(function(...) {
  numposts = blog.info.numposts;
  dosomething()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment