Coder Social home page Coder Social logo

Comments (7)

flegfleg avatar flegfleg commented on July 17, 2024 1

Sorry for my late answer @cstephen
Thanks for your efforts, it works for me now, too.
👍

from hashtag-count.

cstephen avatar cstephen commented on July 17, 2024

Hi @flegfleg, I'm in the process of trying to replicate this. I've had a process running for 3 days so far. I'll let you know if it's still reporting results after 1 week, but I'll keep it running indefinitely and see what I can find.

Since you needed to create new Twitter app credentials to get it working again, I'm wondering if your old credentials were blocked by Twitter. If so, I wonder what caused it. The Twitter Streaming API is supposed to keep connections open infinitely long unless something unusual happens. (See "Disconnections" on this this page.)

This module needs to do a better job of reporting disconnects and attempting to reconnect. I'll create a new issue for that.

from hashtag-count.

flegfleg avatar flegfleg commented on July 17, 2024

Dear @cstephen, thanks for your reply!
I am quite new to node.js, but if you find a way to add reporting, that would be great.

from hashtag-count.

cstephen avatar cstephen commented on July 17, 2024

Just a quick update, my process has been running for 10 days now and is still getting hashtag results. @flegfleg, are your original Twitter app credentials still blocked even after a week has passed?

I've explored the underlying twit module that the hashtag-count module uses for its Twitter Streaming API connections. The twit module has some built-in safeguards to limit the number of connection attempts in a short amount of time. It will wait longer to connect or reconnect if it knows Twitter is rate limiting it.

hashtag-count benefits from these same safeguards, but I think you can still run into trouble if you stop/start your script too often or try to run multiple instances of hashtag-count simultaneously using the same set of Twitter application credentials. I've run into situations where my script has had to wait 30+ seconds to reestablish a connection. So far I have not had my application credentials blocked permanently, however.

I've started working on issue #2. The next version of hashtag-count will communicate connects/disconnects and stop outputing false 0 results while in a disconnected state.

This issue (#1) will serve as a reminder that I need to warn hashtag-count users about Twitter's rate limiting / blocking in the README.

from hashtag-count.

cstephen avatar cstephen commented on July 17, 2024

@flegfleg, a new version of hashtag-count (1.1.0) has been published that no longer records false 0 results when the Twitter Streaming API connection is inactive. It also provides three new optional callback functions connectingCb, reconnectingCb, and connectedCb that allow you to react to connect/disconnect events. You can upgrade your version by running npm update.

See the new "Connection status callbacks and a warning about rate limiting" section of the README and the updated example scripts.

Also, for what it's worth, my test process has been running continuously for 14 days without experiencing any disconnects. I'm going to keep it running for as long as I can to see if any issues come up.

I was able to force disconnect events for development by setting my twit connection timeouts unsually low (10 seconds instead of 60 seconds), but I did that in a separate process.

from hashtag-count.

flegfleg avatar flegfleg commented on July 17, 2024

Thanks a lot @cstephen!
Quite busy with other projects right now, will check it out!

from hashtag-count.

cstephen avatar cstephen commented on July 17, 2024

I'm closing this issue since I've verified that a hashtag-count process can run longer than 1 week without experience any problems, and the latest version is now able to report disconnect/reconnect events.

I'm assuming the Twitter Streaming API credentials were simply blocked by Twitter in this case after some mysterious (undocumented) repeated connection threshold was crossed. I don't think we can ever be sure without some comprehensive timing experiments, but I don't think we can do that without abusing Twitter.

from hashtag-count.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.