Hi, Martin! First of all, congrats for the post!
It would be good to handle the error on: "stream.on('error'...". If you throw the error as it is the upper function, the error will reach the event loop and the application will crash.
A quick solution would be:
stream.on("error", error => console.error(error));
thanks! my only concern would be, if we have the app still running after for example reaching API requests limit for the next 10 hours, are we risking Twitter ban? I think we would also have to implement counter+timer. What you think?
It depends on the Twitter API. But you are not requesting anything to its REST API. You are subscribed to an event. So maybe they manage how much data they can give you.
right, there are limits but its something like 1% above threshold, I updated the post, cheers!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.