draftbit / twitter-lite

A tiny, full-featured, flexible client / server library for the Twitter API
https://npm.im/twitter-lite
MIT License
794 stars 96 forks source link

twitter-lite client stream method always defaults to api version 1.1 #178

Open SaltedCaramelCoffee opened 2 years ago

SaltedCaramelCoffee commented 2 years ago

I'm trying to use twitter-lite with API v2. It looks like the stream method calls getUrl method with the subdomain stream, but never passes in the endpoint version, which makes it always default to 1.1.

The line of code that caused this issue: https://github.com/draftbit/twitter-lite/blob/00052e6b920e642a401f37b66972fd7b8553fa00/twitter.js#L317

I think the solution is to just pass in this.config.version as second parameter to getUrl. Let me know if you think there's a better way to resolve this. I'm happy to make the pull request to fix this issue.

filipmacek commented 2 years ago

Was also looking how to stream with v2, but its not possible with 1.1 as default parameter in getUrl function

kieron commented 2 years ago

Any update on if this is possible to stream v2 yet?

Dani21 commented 1 year ago

Because of this bug, there is now no usable version of this API endpoint that'll work. Twitter is deprecating all v1.1 streaming APIs in a month: https://twittercommunity.com/t/announcing-the-deprecation-of-v1-1-statuses-filter-endpoint/182960

I'm going to use the following library instead which has way better support and is being actively maintained: https://github.com/plhery/node-twitter-api-v2