dimdenGD / OldTweetDeck

Returns old TweetDeck, for free!
MIT License
1.9k stars 113 forks source link

expanding tweet not working anymore #124

Closed ogbrana closed 8 months ago

ogbrana commented 1 year ago

so bad news... :( Screenshot_1

ogbrana commented 1 year ago

so bad news... :( Screenshot_1

after marked "enable bypass" on options, this function go back to work partially.

Stochos commented 1 year ago

OldTweetDeck: "Expand Tweet" link missing image image

https://twitter.com/AsYouNotWish/status/1706425601903759434

image

Additional examples. https://twitter.com/InvestingCanons/status/1706430184507756692

Whirblewind commented 1 year ago

Does seem like something is up, at least sometimes. Noticed a Japanese tweet that doesn't have the expand button and should, and when I hit translate it expanded it, but I also have English tweets that are showing the expand button just fine. OTD for chrome 3.1.8, +BTD, bypass button is off.

unirun commented 9 months ago

I've investigated the issue with the "Expand Tweet" button not appearing for Japanese tweets and identified a likely cause. The problem arises due to a condition in the code found here: https://github.com/dimdenGD/OldTweetDeck/blob/main/files/bundle.js#L22228.

Japanese tweets often fail to meet the condition for displaying the "Expand Tweet" button, which seems less common in languages that use space-separated words.

The issue stems from the way long tweets are truncated, indicated by the insertion of an ellipsis ("…"). For tweets under 140 characters, any text following the closest line break or space to the 140th character is omitted and replaced with "…". In Japanese tweets, where space characters are rarely used, the text is typically truncated after the last line break. According to the mentioned code, the "Expand Tweet" button is displayed when text.length is between 275 and 400, which equates to approximately 138 to 200 characters in Japanese.

Therefore, in Japanese, the "Expand Tweet" button will not appear unless, by chance, there's a line break at the 139th or 140th character, or if there are no line breaks or spaces within the first 140 characters. In English, the button won't appear if there are no spaces between the 275th and 280th characters.

We sometimes see Japanese tweets where only the first dozen characters are displayed, and the rest is truncated. This happens when there's a line break after the initial greeting, followed by text without any line breaks or spaces.

This issue seems to stem from the API used by TweetDeck. Since the data sent by Twitter is already truncated, it's impossible to determine from the data whether a tweet has been shortened. A 100% reliable solution appears unfeasible. The only practical approach might be to display the "Expand Tweet" button unconditionally whenever an ellipsis is present at the end of a tweet. Personally, I find this solution acceptable, but what are your thoughts, @dimdenGD?

unirun commented 8 months ago

First and foremost, I'd like to extend my gratitude to @dimdenGD for making adjustments to accommodate Japanese tweets by changing the threshold. However, we are still facing the following issues:

In OldTweetDeck, the display appears as follows: image

On the other hand, on Twitter itself, it looks like this: image

The point at which Japanese tweets are truncated with "…" is very flexible, and setting a fixed threshold will almost certainly miss some cases. It would be greatly beneficial if there were an option in the settings to either adjust this threshold or to display the Expand Tweet option regardless of the character count.

dimdenGD commented 8 months ago

I lowered limit even more and now it shows up for this tweet