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

Button is gone #27

Open
solserer-labs opened this issue Dec 22, 2022 · 8 comments
Open

Button is gone #27

solserer-labs opened this issue Dec 22, 2022 · 8 comments

Comments

@solserer-labs
Copy link

Seems that twitter updated their css/layout or something and now the button is gone.

Any chance for any update?

@mstfsnc
Copy link
Owner

mstfsnc commented Dec 22, 2022

Hi @solserer-labs,

Twitter api url has changed. Update here b3bbc6f

@gpuido
Copy link

gpuido commented Dec 27, 2022

Hello, I've been using your extension as a guide to try to write a simple tweet request.
It is way over my knowledge but I could get the json for a tweet by id without authentification with this request :

https://twitter.com/i/api/2/timeline/conversation/${id}.json?tweet_mode=extended

could you help me to rewrite this with the new url type or head me in the right direction ?

function FetchPost (  id, headers = {} ) 
{
	let url = `https://twitter.com/i/api/2/timeline/conversation/${id}.json?tweet_mode=extended`
	return fetch ( url, { credentials: "include", headers: new Headers(headers), } )
	.then ((response) => response.json())
}

@mstfsnc
Copy link
Owner

mstfsnc commented Dec 27, 2022

Hi @gpuido,

There is no way to request api without authentication. In the old version, I was using some headers while trying to make a request to the api.

@gpuido
Copy link

gpuido commented Dec 28, 2022

Thank you for the help @mstfsnc,

Oh, i think I understand how you do it the new version ! very smart !!

You don't do the request yourself, but you intercept the response request made by twitter.com to twitter api ?

you analyse every XMLHttpRequest in xhr.js and callback your code with the obj when url match api.twitter.com.

This is beautifull code. Do I understand right ?

@mstfsnc
Copy link
Owner

mstfsnc commented Dec 29, 2022

Thank you for the help @mstfsnc,

Oh, i think I understand how you do it the new version ! very smart !!

You don't do the request yourself, but you intercept the response request made by twitter.com to twitter api ?

you analyse every XMLHttpRequest in xhr.js and callback your code with the obj when url match api.twitter.com.

This is beautifull code. Do I understand right ?

Yes, absolutely right.

@gpuido
Copy link

gpuido commented Dec 30, 2022

Thank you very much for sharing @mstfsnc. 🙏

@gpuido
Copy link

gpuido commented Dec 30, 2022

One idea I use in many of my tools, you might find interesting is ::

when the user click the download button,
IF some text is selected, the extension use the selected text ( filter window.getSelection().toString() )
to define the filename to save ( "Pelé's bicycle kick against the Miami Toros in 1976.mp4" )

I find it very usefull to quickly give a not too long and meaningful file name without typing.

image

@lordhater1
Copy link

Button has disappeared again, probably due twitter's API

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

No branches or pull requests

4 participants