redouane59 / twittered

Twitter API client for Java developers
Apache License 2.0
236 stars 64 forks source link

Сan i get a list of tweets that a person has liked? #342

Closed Programistich closed 2 years ago

redouane59 commented 2 years ago

I don't think that such endpoint exists. For now you can only see the likes of an authenticated user.

Programistich commented 2 years ago

But Twitter have that api https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list

Programistich commented 2 years ago

image image

redouane59 commented 2 years ago

Sorry I was wrong, the authentication is not needed. Try to use getLikedTweets method !

Programistich commented 2 years ago

From User or what?

redouane59 commented 2 years ago

From TwitterClient , it's a V2 method :)

Programistich commented 2 years ago

But i need to setup Oath2? How i can that in TwitterCredentials?

redouane59 commented 2 years ago

You just need to instantiate the TwitterClient with your credentials yes. Then you can check the example on the integration test : https://github.com/redouane59/twittered/blob/develop/src/test/java/io/github/redouane59/twitter/nrt/ITwitterClientV2Test.java#L460

redouane59 commented 2 years ago

For the instantiation of the TwitterClient, check the readme : https://github.com/redouane59/twittered#readme

redouane59 commented 2 years ago

Can I close this issue ?

knutwannheden commented 2 years ago

I just tested this method and it works. In the documentation it is mentioned that the endpoint supports pagination. But with this Java method I always get all liked tweets, which can be a lot and quite slow. Let me know if I should report a separate issue for this.

knutwannheden commented 2 years ago

Never mind, I missed the overload with the AdditionalParameters 🤦

redouane59 commented 2 years ago

Don't worry haha, can we close the issue ?