redouane59 / twittered

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

How to obtain Entities attached to a given Tweet object? #271

Closed rzo1 closed 3 years ago

rzo1 commented 3 years ago

Hi @redouane59 ,

thanks for providing an alternative library to twitter4j (which seems to be dead...)

I might be wrong, but I couldn't find code to obtain the entities attached to a certain Tweet with the library? Am I right?

For v1.1 I am basically interested in the entities and the related index positions as described here and here.

For v2.2 it looks pretty similar: here.

So I am wondering:

Maybe you can summarize which parts of twitterd are still WIP ?

Thanks & Gruss Richard

redouane59 commented 3 years ago

Hi @rzo1 ,

getEntities() method is not part of the Tweet interface, nobody asked it before but you're right, it should be there. I'll add it on the next release.

Currently you can use ((TweetV2)tweet).getData().getEntities() to have it. Please confirm to me that this is working.

rzo1 commented 3 years ago

Thanks for the fast response.

I think, it would be neat to have the entites as fully parsed DTOs (annotations, hashtags, cashtags, mentions, urls) to avoid doing JSON parse magic on the client side. wdyt?

redouane59 commented 3 years ago

Yes that's true, it was just implemented like this by lack of time. If you want to do it don't hesitate to submit a PR, otherwise it will wait a little bit more :)

rzo1 commented 3 years ago

Think, this is fixed now.