redouane59 / twittered

Twitter API client for Java developers
Apache License 2.0
237 stars 65 forks source link

doesn't support Academic Research product , tweet.getUser() always null java.lang.UnsupportedOperationException and need of attribute "source" #250

Closed Boby024 closed 3 years ago

Boby024 commented 3 years ago

It doesn't support "Academic Research product" such as "maxResult=500" User detail per Tweet is always empty. Could be also possible to get the "source" (which device was used to create the tweet)

redouane59 commented 3 years ago

Hi @Boby024 , can you precise which method you are calling ? Thanks !

Boby024 commented 3 years ago

Hi @redouane59, I used "searchForTweetsFullArchive"

redouane59 commented 3 years ago

Ok I see. Currently the Twitter API doesn't return the user information inside the Tweet object for this endpoint. I already posted a feedback about this bad structure in Twitter dev feedback forum here. It would be useful if you +1 this.

What I could do waiting for any change on the Twitter side is to make evolve the TweetList object and add the includes structure to be able to find related user there. What do you think ?

I'll check to add source too.

redouane59 commented 3 years ago

Fix will be available in the next release 2.5 in the following days :)

Boby024 commented 3 years ago

@redouane59 thanks for the feedback and the future improvement. please keep also in mind to enhance 100 to 500 the "maxResult" parameter.

redouane59 commented 3 years ago

please keep also in mind to enhance 100 to 500 the "maxResult" parameter.

Is it allowed ? I just put back 100 because the API gave me an error saying the max_result param should be between 10 and 100.

redouane59 commented 3 years ago

Hmmm don't know what happened, i don't have anymore the error, I just put back 500.

Boby024 commented 3 years ago

I got the same error again: {"errors":[{"parameters":{"tweet.fields":["attachments,author_id,created_at,entities,geo,id,in_reply_to_user_id,lang,possibly_sensitive,public_metrics,referenced_tweets,source,text,withheld,context_annotations,conversation_id,reply_settings"],"max_results":["500"]},"message":"when requesting tweet.fields=context_annotations max_results must be less than or equal to 100"}],"title":"Invalid Request","detail":"One or more parameters to your request was invalid.","type":"https://api.twitter.com/2/problems/invalid-request"} - 400

Boby024 commented 3 years ago

here you can see a proof above 500 "maxResult" (under certain conditions) from a Twitter staff: https://twittercommunity.com/t/api-twitter-v2-academic-research/156497/5

redouane59 commented 3 years ago

Oh ok so the problem is related to context_annotations field...

Boby024 commented 3 years ago

I couldn't find this method "searchAllTweets"

redouane59 commented 3 years ago

I couldn't find this method "searchAllTweets"

Which version are you using ? Please update your pom and use the latest one :) The method was renamed.

Boby024 commented 3 years ago

Aaah ok I'm actually using 1.26 which is the newest? https://mvnrepository.com/artifact/com.github.redouane59.twitter/twittered

redouane59 commented 3 years ago

which is the newest?

The last release is 2.4 and all these fixes will be included in the version 2.5

Boby024 commented 3 years ago

thanks

redouane59 commented 3 years ago

You can now use v2.5 :) https://github.com/redouane59/twittered/releases/tag/v2.5