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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:29:59+00:00 2026-05-28T23:29:59+00:00

I am writing a web crawler for reddit which only allows 1 request every

  • 0

I am writing a web crawler for reddit which only allows 1 request every 2 seconds and would like to use recursion to make the requests. After the series of get requests for 1 persons comments are complete, I would like to emit to show completion and call the comments again on the next username in a message queue. The problem is whenever I am more than one level deep I get a “TypeError: Object # has no method ’emit'”.

I am also open for better ways to do this, I have just started learning node and am sure there are much better ways to accomplish this.

I have posted my code in the gist below…any help would be awesome!

https://gist.github.com/1729182

  • 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-28T23:29:59+00:00Added an answer on May 28, 2026 at 11:29 pm

    The issue is with this which is a keyword (not free variable) that evaluates to the “receiver” for the function call.

    For instance, given:

    x = {fn: function () {return this} }
    x.fn()
    

    Then inside fn, this evaluates to what x evaluated to (and thus x.fn() === x). In the code grabComments is being invoked with no receiver, in which case this reverts to the global object. You may be interested in Function.call/apply, or just simplify the code to handle recursion with a nested function so that self can remain bound-to in scope.

    (In JavaScript, methods are not bound to objects: they are merely functions shoved into properties, so the receiver is paramount in determining this for the executiong function.)

    See also:

    • jQuery/JavaScript "this" pointer confusion
    • In Javascript, why is the "this" operator inconsistent?
    • Javascript "this" variable confusion
    • How do JavaScript closures work?

    Happy coding.

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

Sidebar

Related Questions

I am writing a crawler in Perl, which has to extract contents of web
I'm writing a web crawler and want to ignore URLs which link to binary
I'm writing a simple web crawler in Ruby and I need to fetch all
I'm writing a multi-threaded Java web crawler. From what I understand of the web,
Several frameworks for writing web-based desktop-like applications have recently appeared. E.g. SproutCore and Cappuccino
Which of these two platforms/ecosystems are better for writing web applications/websites? I am not
I'm just getting started writing a simple web crawler to get info on links
I am writing my own specific web crawler for product selling websites. Due to
I'm writing web application that uses Spring MVC to bind Spring beans with REST-like
I'm writing a web crawler for a specific site. The application is a VB.Net

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.