ttezel / twit

Twitter API Client for node (REST & Streaming API)
4.31k stars 568 forks source link

Has the August 16th, 2018 endpoint migration been adressed? #458

Open GarkGarcia opened 6 years ago

GarkGarcia commented 6 years ago

Hey, I have a Twitter bot which was working fine, but I noticed it stopped working a while ago (I'm getting Error: Bad Twitter streaming request: 410).

I've researched about it and I found out many legacy endpoints and services are getting switched off right about today. Has this been addressed yet?

super-ienien commented 6 years ago

Hi,

everything is described here : https://twittercommunity.com/t/details-and-what-to-expect-from-the-api-deprecations-this-week-on-august-16-2018/110746

There will be a period of flickering and then twitter will shutdown the user streams on 23rd of august.

GarkGarcia commented 6 years ago

@super-ienien Yep. According to the developer.twitter link I posted here:

Site Streams and User Streams will be fully retired on August 23rd

I'm asking if the Twit API has already been updated to addressed those changes (or if it will be updated soon). Will the Twit.stream() function be deprecated then? How's Twit going to change on regards to this update?

super-ienien commented 6 years ago

Sorry for my misunderstanding.

Twitter announced thoses changes 6 months ago. I think if the author of Twit had planned to do something he would have done it already.

vineeth030 commented 6 years ago

I also have a twitter Bot using twit which is giving same error message. I got this package, twitter-webhooks to use Activity API of twitter. If anyone here have a better idea please let me know.

maziyarpanahi commented 6 years ago

By addressing you mean only two things possible:

1- Removing those functions since they are being deprecated: They haven't entirely been shut down. So removing them won't be fair to other people who are still using them. Also, just a change in the documentation to say these two are being deprecated is enough. No need to remove anything in the code.

2- Implementing the new User Stream and Site Stream (Sandbox - Premium APIs): This requires Developer Approval process (from 1 week all the way to 5 weeks or more!). You have to be approved and pass to see how these APIs really work and be able to test them. It is not as simple as creating an application before. I understand if the maintainers and contributors are taking their time until everything is already settled or in the queue to be approved.

Will the Twit.stream() function be deprecated then? If you mean Twitter Public Streaming APIs, the answer is yes but not soon. It has been in the roadmap for a while, but they haven't moved on to it yet as the other APIs impact their business more than Streaming APIs.

My suggestion, if your app entirely relies on Site Stream and User Stream then you should use other libraries.

vineeth030 commented 6 years ago

Thank you @maziyarpanahi

GarkGarcia commented 6 years ago

@maziyarpanahi I thought about adapting those function to make use of webhooks or something along those lines, but I don't really know how that would work. Maybe deprecating those functions and creating new ones - based on webhooks technology - would be a good idea too.

Sure, I understand if the developers take their time.

As for myself, I think I'm gonna dig a little bit into the Twitter API and see if I can replicate everything just how it was.

vineeth030 commented 6 years ago

@GarkGarcia I finally referred their official code sample https://github.com/twitterdev/account-activity-dashboard That helped me.

super-ienien commented 6 years ago

@vineeth030 Did you try twitter-webhooks module ?

I’m the author, if you tried i’m Interested by your feedbacks and reasons you didn’t use it. It would help me to make improvements on it. Thanks ;)

super-ienien commented 6 years ago

@GarkGarcia I was in your case and that's why I did twitter-webhooks. It implements all you need to receive twitter user events like user stream.

But the new User Activity API is much more restrictive than the User Stream API... First you need a server or an App running on a Machine reachable by Twitter via an URL, second you need HTTPS and third your App needs to be approved by Twitter.

vineeth030 commented 6 years ago

@super-ienien I only had 8 hours to make my Bot working again. So when I got stuck in some errors. I looked for alternative. But I did referred your module code a lot. It did help me along the way. When I get free time I`ll get back to it. Thats a great effort, creating that module.

super-ienien commented 6 years ago

@vineeth030 Ok thanks ;)

alveshelio commented 6 years ago

Hi guys,

I'm working on a small project and one of the requirements is to get tweets from a specific user. @vineeth030 Do you think you could share what you did as work around?

@super-ienien I've checked your module and in userActivity, it seems that we can only subscribe to a user if we know the userId and the accessToken and accessTokenSecret, it means your own account. Is there a way to get tweets from another account and display them on a dashboard?

Thank you

super-ienien commented 6 years ago

@alveshelio Account Activity API is not what you need...

You just need this : https://developer.twitter.com/en/docs/tweets/filter-realtime/guides/basic-stream-parameters

This feature is supported by Twit. Anyway, you'll still need to get the userId of the users you wan't to follow, you can retrieve them easily by using the Twitter's REST API. Just look into the doc.

tracycollins commented 6 years ago

How should I handle Error: Bad Twitter streaming request: 410?

Right now, it crashes my app. I'm already listening for and handling stream errors already.

vineeth030 commented 6 years ago

@tracycollins stream APIs has been deprecated. Use account activity API if your requirement is to listen to direct message or tweets.

dandv commented 5 years ago

Not sure if this library is actively maintained. twitter-lite is, and we're happy to look into this if you test the functionality and file an issue.