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

[Twitter] Legacy website design being discontinued on June 1, 2020 #1562

Closed
VerifiedJoseph opened this issue May 9, 2020 · 62 comments
Closed
Labels
Bug-Report Confirmed bug report

Comments

@VerifiedJoseph
Copy link
Contributor

VerifiedJoseph commented May 9, 2020

Twitter is discontinuing the 'legacy' website design, which currently powers this bridge, on June 1, 2020.

Capture2

@VerifiedJoseph VerifiedJoseph added the Bug-Report Confirmed bug report label May 9, 2020
@em92
Copy link
Contributor

em92 commented May 10, 2020

Ping @pmaziere.

@triatic
Copy link
Contributor

triatic commented Jun 1, 2020

June 1 is here, about half of my twitter feeds are now returning no data.

image

@triatic
Copy link
Contributor

triatic commented Jun 2, 2020

All Twitter feeds showing zero results now. I guess the 50/50 results I saw earlier was due to some servers not having shut down legacy support.

@Nono-m0le
Copy link
Contributor

@teromene do you know who was responsible for this bridge? If not, any idea who can propose a PR for that?

@triatic
Copy link
Contributor

triatic commented Jun 3, 2020

The maintainer is @pmaziere , but anyone is welcome to propose a PR!

@drego85
Copy link
Contributor

drego85 commented Jun 4, 2020

Hi Team,
I've done several tests but currently I don't think there is an effective solution.

Let me explain...

Twitter from 1 June requires a browser with javascript to view the tweets (that is load the tweets with javascript).

If I disable JavaScript in my Firefox browser, I see the message:

We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?

If I confirm and I'm directed to:

https://mobile.twitter.com/

Well, I thought.

We scrap the data from the mobile version, change the structure of the page (must change all the references in the code) but it works. I have a working version locally.

But, and here's the real problem, if I do a search I don't see recent results.

For example, if I search for "AndreaDraghetti" in the mobile version I see very old results. In the Desktop version of a few hours ago.

Try it too (remember to disable JavaScript in the desktop version):

https://mobile.twitter.com/search?q=AndreaDraghetti&s=typd&x=0&y=0
https://twitter.com/search?q=AndreaDraghetti&src=typed_query&f=live

I don't know how you can fix this :(

@Pofilo
Copy link
Contributor

Pofilo commented Jun 4, 2020

Hey @drego85, this URL seems to work with the mobile version:

https://mobile.twitter.com/search?q=AndreaDraghetti&src=typed_query&f=live
(just changed the end of the URL)

@drego85
Copy link
Contributor

drego85 commented Jun 4, 2020

It absolutely works, but the results are not recent. The last result shown is from May 30th (in the desktop version it is today)..

@Pofilo
Copy link
Contributor

Pofilo commented Jun 4, 2020

Well, with this mobile URL (https://mobile.twitter.com/search?q=AndreaDraghetti&src=typed_query&f=live), I have the same results than on the other version:
twitter-mobile

@drego85
Copy link
Contributor

drego85 commented Jun 4, 2020

You haven't disabled JavaScript :)

This is the graphical interface with JavaScript disabled:
Schermata 2020-06-04 alle 10 12 49

@Pofilo
Copy link
Contributor

Pofilo commented Jun 4, 2020

Okay my bad ..

@drego85
Copy link
Contributor

drego85 commented Jun 4, 2020

No problem, better to make multiple checks ;)

@triatic
Copy link
Contributor

triatic commented Jun 4, 2020

@drego85 We can simulate the actions of Javascript, we just have to work out what the Javascript is doing and write it in PHP.

@somini
Copy link
Contributor

somini commented Jun 5, 2020

This is a bummer.

There's always Nitter for a quick hack, until this is solved: https://github.com/zedeus/nitter

@teromene
Copy link
Member

teromene commented Jun 5, 2020

I have pushed an update to TwitterBridge.
It required a major rewrite, and probably still has problems that needs to be quelled.

@drego85
Copy link
Contributor

drego85 commented Jun 5, 2020

Thanks @teromene great workaround, I didn't know that "tokens" would be released to guest users.

@teromene
Copy link
Member

teromene commented Jun 5, 2020

Can you share your input parameters as well as eventually your log @Nono-m0le ?

@triatic
Copy link
Contributor

triatic commented Jun 5, 2020

Excellent work @teromene , I can confirm successful operation in cli mode.

@kinoushe
Copy link

kinoushe commented Jun 5, 2020

Glad it's working again! Thanks @teromene

One problem is that display_url doesn't appear to be the correct usage for the img src - it results in broken images.

The media_url_https works correctly for the enclosures, and I think this should be used for $display_image also.

For the enclosures could we instead retain the 'orig' tag as before to retrieve the original sized images here?

The following works correctly for me:

$image = $media->media_url_https . '?name=orig';
$display_image = $media->media_url_https;

@doowruc
Copy link

doowruc commented Jun 5, 2020

It's not working in my heroku instance.

I did my usual process of pull from here, push to heroku, and heroku triggered a deploy.

I get an error: Bridge returned error 429! (18418)

with detail in HTML format:

Twitter @github was unable to receive or process the remote website's content!
Error message: `The requested resource cannot be found!
Please make sure your input parameters are correct!
cUrl error: (0)
PHP error: `
Query string: `action=display&bridge=Twitter&context=By+username&u=github&noimgscaling=on&format=Html`
Version: `dev.2020-02-26`

or in plaintext format:

<p class="exception-message"><strong>Twitter @github</strong> was unable to receive or process the
remote website's content!<br>
Error message: `The requested resource cannot be found!<br />
Please make sure your input parameters are correct!<br />
cUrl error:  (0)<br />
PHP error: `<br />
Query string: `action=display&bridge=Twitter&context=By+username&u=github&format=Mrss`<br />
Version: `dev.2020-02-26`</p>

All modes in all formats give the same error

@doowruc
Copy link

doowruc commented Jun 5, 2020

I just deployed to a new heroku app using the button on the repo front page and the new instance also has the same error

@teromene
Copy link
Member

teromene commented Jun 5, 2020

429 response is when twitter considers that you have made too many requests
I will look into it

@drego85
Copy link
Contributor

drego85 commented Jun 5, 2020

@doowruc I think to avoid this limitation, you can customize the code by adding two valid API tokens generated by the Twitter development site.

@doowruc
Copy link

doowruc commented Jun 5, 2020

@drego85 add them where?

@drego85
Copy link
Contributor

drego85 commented Jun 5, 2020

Line 346 and 347 and you can find more info of bearer tokens here.

However I haven't personally tried.

@Pofilo
Copy link
Contributor

Pofilo commented Jun 5, 2020

The last commit fixes the Bridge, thanks ! :)
But I have some remarks:

I may have the time this weekend for a MR, not sure.

@nousernameavailableanymore

The twitter rss-bridge suddenly started working again for me. Except for the still broken images. Is this a known issue as well?

@kinoushe
Copy link

kinoushe commented Jun 7, 2020

Yes, the broken images is a known issue @nousernameavailableanymore, see #1562 (comment) for the fix.

@nousernameavailableanymore

I have no clue what that means?
Assume that someone had no clue whatsoever about webdevelopment.
How would this person fix the issue?

@kinoushe
Copy link

kinoushe commented Jun 7, 2020

@nousernameavailableanymore just wait for the bridge to be updated with the fix then.

somini added a commit to somini/rss-bridge that referenced this issue Jun 8, 2020
@somini
Copy link
Contributor

somini commented Jun 8, 2020

@teromene Many thanks for updating the bridge, I appreciated it very much.

I opened #1591 to include the fix @kinoushe mentioned above. Another regression is that t.co links are no longer resolved, and if they refer to another tweet, that tweet would be shown in the item contents.

@kinoushe
Copy link

kinoushe commented Jun 8, 2020

Since we're now using the Twitter API it's possible to include videos:
$media->video_info->variants[0]->url

We would need to loop through the variants[] to find the highest bitrate:
https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/extended-entities-object#tweet-video

And then render video HTML instead of the image HTML, with the url as src and media_url_https as the video poster.

@nousernameavailableanymore

Will there be a new docker image with these changes?

@teromene
Copy link
Member

teromene commented Jun 8, 2020

I have pushed a new update.
This should fix images, profile names as well as introduce a new caching strategy for guest tokens.

@kinoushe
Copy link

kinoushe commented Jun 8, 2020

@teromene are we able to keep the ?name=orig size on the enclosure images as before?

$image = $media->media_url_https . '?name=orig';

media_url_https and media_url bring in a downsized image from my testing.

@danielsale
Copy link

Getting a 403 on lists again.

somini added a commit to somini/rss-bridge that referenced this issue Jun 9, 2020
@somini
Copy link
Contributor

somini commented Jun 9, 2020

Since we're now using the Twitter API it's possible to include videos:
$media->video_info->variants[0]->url

When an advertiser chooses to limit video playback to just Twitter owned and operated platforms, the video_info object will be replaced with an additional_media_info object.

Note the video_info object might not exist.

@kinoushe
Copy link

kinoushe commented Jun 9, 2020

@somini oops, I missed that disclaimer. But I think conditionally displaying most/non advertiser videos would be better than nothing at all as current.

From my limited testing the past few days video_info works well.

@somini
Copy link
Contributor

somini commented Jun 9, 2020

@somini oops, I missed that disclaimer. But I think conditionally displaying most/non advertiser videos would be better than nothing at all as current.

From my limited testing the past few days video_info works well.

I'll include a first pass on this on #1595 . It also supports "animated GIF", exposed as videos.

Thanks for digging into the API.

somini added a commit to somini/rss-bridge that referenced this issue Jun 9, 2020
@kinoushe
Copy link

kinoushe commented Jun 9, 2020

Excellent, thanks @somini!

@triatic
Copy link
Contributor

triatic commented Jun 9, 2020

@teromene the caching strategy is better now but I think we need to expire tokens based on time as well as usage.

@nousernameavailableanymore

I updated to the latest docker image yesterday. For some reason the version it still shows RSS-Bridge as version "dev.2020-02-26".
Unfortuantely I still get 403s for the most part. Sometimes it seems to work sporadically but I still got the broken images.

@teromene
Copy link
Member

teromene commented Jun 9, 2020

@triatic It should expire at the same time as the default cache expiration time
@nousernameavailableanymore The version thing is normal AFAIK, I have not had time to update it yet. The images and 403 should be fixed in the latest build

@triatic
Copy link
Contributor

triatic commented Jun 9, 2020

@teromene are you saying the token should last no longer than CACHE_TIMEOUT in the bridge (normally 5 minutes) when it is used under 100 times? Because I'm not seeing that behaviour here.

teromene pushed a commit that referenced this issue Jun 10, 2020
* Keep old URI structure

Use the username, not the user ID.

* Fix Twitter bridge images

Credit to @kinoushe

See #1562 (comment)

* Include Videos and "Animated GIF" as twit enclosures

Credit to @kinoushe for digging into the API docs.

#1562 (comment)

* Calculate the highest bitrate video

Include that on the enclosure.

* Appease linter

* Appease linter, again

* Remove surrounding link from videos

Add it on a smaller link besides it.

See
#1595 (comment)

* Include video poster on the enclosures.
@ShaneZampire
Copy link

I use to have #Breaking tweets displayed on my web page till the new Twitter came out and it stopped working. I just replaced the old Twitter Bridge with the new one and now I get the image below. Do I need to replace other files or is this still being worked on? Thanks
Twitterbridge

@em92
Copy link
Contributor

em92 commented Jul 24, 2020

@ShaneZampire pull latest version of TwitterBridge. It is probably fixed already

@em92 em92 closed this as completed Jul 24, 2020
@ShaneZampire
Copy link

I just tried the latest as of 4 days ago. I guess Twitter's new version has broke it for good for us :( I am thankful for all the hard work that went into this project. Before Twitter broke it, it worked awesome and I am super grateful for the months I did get to use it.
Twitterbridge

@em92
Copy link
Contributor

em92 commented Jul 30, 2020

@ShaneZampire, the screenshot you gave does not tell anything to me. You need to provide full text of error.
Also are you using Memcached?

comlaterra pushed a commit to comlaterra/rss-bridge that referenced this issue Sep 25, 2020
…idge#1595)

* Keep old URI structure

Use the username, not the user ID.

* Fix Twitter bridge images

Credit to @kinoushe

See RSS-Bridge#1562 (comment)

* Include Videos and "Animated GIF" as twit enclosures

Credit to @kinoushe for digging into the API docs.

RSS-Bridge#1562 (comment)

* Calculate the highest bitrate video

Include that on the enclosure.

* Appease linter

* Appease linter, again

* Remove surrounding link from videos

Add it on a smaller link besides it.

See
RSS-Bridge#1595 (comment)

* Include video poster on the enclosures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-Report Confirmed bug report
Projects
None yet
Development

No branches or pull requests