FixTweet / FxTwitter

Fix broken Twitter/X embeds! Use multiple images, videos, polls, translations and more on Discord, Telegram and others
https://fxtwitter.com
MIT License
2.42k stars 65 forks source link

iframes, embeds, redirects... and custom deployments if necessary #774

Open techdragon opened 3 months ago

techdragon commented 3 months ago

I'm trying to get reliable twitter link previews, and I'm pretty happy with FxTwitter generally... so I thought surely there's a way to use this in my own personal app (as in an app I'm building to use myself, not my own app I plan to share or sell) to render an iframe style embedded preview... but I've been trying out user agents based on the source code regex and I'm still getting bumped to the original twitter urls which is causing issues due to twitter and the in app WebKit user agent... but all that aside... the point of this issue is to ask... If I want a stand alone HTML preview of a tweet rendered using the FxTwitter application stack, like if you used the publish.twitter.com embedded links, just not as crap and avoiding all the issues involved in using Twitter directly... what should I be doing?

I'm not opposed to modifying something and deploying my own copy of the entire stack, but I'm just not sure what (if the capability even exists, since I'm not completely sure there's an equivalent HTML rendering endpoint) I should be changing in order to mark out a custom user agent and reliably request the correct endpoint to get a HTML rendering of the tweet?

Do I need to implement some javascript or something else to 'pre-render" the html based on an endpoint? What is the step in the chain I'm missing? Do I even need a custom deployment?

original tweet link -> FxTwitter -> ??? -> HTML a browser can display.

dangeredwolf commented 3 months ago

We have our JSON API but currently don't have an iframe for tweet embeds yet. It's something I've thought about offering though.

Apreche commented 1 week ago

I want this quite a bit. It's quite a bit of work to take the JSON API and use that to get some HTML and CSS that looks good. If anyone knows of a pre-existing template I can use, I would be thankful.