Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support extended tweets #247

Merged
merged 5 commits into from
Dec 24, 2016
Merged

Conversation

takke
Copy link
Contributor

@takke takke commented Sep 18, 2016

To support extended tweets, add configuration of "tweet_mode=extended" and some fixes.


日本語はこちら↓

@samruston
Copy link

Any updates on this PR?

@@ -77,6 +77,9 @@
if (conf.isIncludeExtAltTextEnabled()) {
params.add(new HttpParameter("include_ext_alt_text", "true"));
}
if (conf.isTweetModeExtended()) {
params.add(new HttpParameter("tweet_mode", "extended"));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an enum would be useful here to illustrate the allowed values of tweet_mode ("compat" and "extended")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need you need to change the size of the params variable:

List params = new ArrayList(4);

@@ -73,6 +73,7 @@
private boolean includeEntitiesEnabled = true;
private boolean trimUserEnabled = false;
private boolean includeExtAltTextEnabled = true;
private boolean tweetModeExtended = false;
Copy link

@matthewbogner matthewbogner Sep 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would favor this being a String or Enum value to accommodate any future usage of this tweet_mode parameter by Twitter with new values.

@frangarcia
Copy link

It would be nice to have this pull request merged when possible as Twitter has already started to roll out some changes to support more than 140 chars when using other entities like hashtags or urls https://dev.twitter.com/overview/api/upcoming-changes-to-tweets

@@ -81,6 +81,15 @@ public String getText() {
return getTarget().getText();
}

@Override

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to add the Override annotation

return getTarget().getDisplayTextRangeStart();
}

@Override

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to add the Override annotation

@@ -48,6 +48,10 @@
*/
String getText();

int getDisplayTextRangeStart();
Copy link

@frangarcia frangarcia Sep 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add the javadoc part for those 2 methods

 (for extended_tweet.entities.media and entities on DMs)
@takke
Copy link
Contributor Author

takke commented Sep 28, 2016

MediaEntityをExtendedMediaEntity相当にする修正を行いました。

GIF動画や動画を含む140文字超ツイートをStreamingで取得した場合に、extended_tweet.entities.media に載る動画情報を取得できるようにするためです。

DMのGIF動画や動画についても同様で、#234 は不要になるのでクローズしました。

詳細は Twitter4JのExtendedMediaEntity廃止について - Qiita にまとめてあります。

@YousefED
Copy link
Contributor

What's needed before supporting / merging this? I can help if necessary, Twitter already switched to extended tweets, so we'd need this ourselves sooner than later.

@takke takke mentioned this pull request Sep 30, 2016
@paulpach
Copy link

What else is needed to merge this? it sucks having to maintain our own builds.

@tjallingt
Copy link

Hey, Just checking in on this pull request to mention how important it is to merge this soon as Twitter already heavily relies on extended_tweet's...
Any ETA for when this will be merged?

@mrkumarawanish
Copy link

mrkumarawanish commented Nov 15, 2016

When we can expect to have tweet_mode feature in twitter 4j library?

@vickyst
Copy link

vickyst commented Nov 25, 2016

Just wanted to add my voice to the requests for this - is there an ETA for this?

@lmserrano
Copy link

Also looking forward to have this soon. Any ETA yet? Is there any help needed?

@yusuke yusuke merged commit d25b340 into Twitter4J:master Dec 24, 2016
@yusuke
Copy link
Collaborator

yusuke commented Jan 6, 2017 via email

@paulpach
Copy link

paulpach commented Jan 6, 2017

there is no 4.4.5 version in maven central. The latest version is 4.0.6

@frangarcia
Copy link

I think @yusuke got confused with the version and he meant 4.0.5 https://mvnrepository.com/artifact/org.twitter4j/twitter4j-core/4.0.5

@frangarcia
Copy link

frangarcia commented Jan 11, 2017

@yusuke can you please confirm which version of twitter4j has this pull request merged in? I was just checking 4.0.5 and it does not seem to have this pull request. If 4.0.5 does not have this pull request, is 4.0.6 a final/stable version? 4.0.6 definitely has this pull request merged in.

@MattWilliams89
Copy link

Thanks for merging this, working well on 4.0.6 for me

takke pushed a commit to takke/Twitter4J that referenced this pull request Jul 23, 2018
@takke takke deleted the support_extended_tweets branch October 23, 2018 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet