FixTweet icon indicating copy to clipboard operation
FixTweet copied to clipboard

Cant fetch activity embeds

Open arenasys opened this issue 6 months ago • 4 comments

curl -A "Discordbot/2.0" "https://fxtwitter.com/majin_kz/status/1928552476589932644" Gives me an activity embed link: <link href='https://fxtwitter.com/users/majin_kz/statuses/66086667665361546057575456595857606161555458565666' rel='alternate' type='application/activity+json'>

curl -A "Discordbot/2.0" -v "https://fxtwitter.com/users/majin_kz/statuses/66086667665361546057575456595857606161555458565666" Just gives a 302 redirect to https://github.com/FxEmbed/FxEmbed?

arenasys avatar Jun 06 '25 16:06 arenasys

Can see in https://github.com/FxEmbed/FxEmbed/blob/main/src/realms/twitter/router.ts that nothing matches that URL, it wants https://fxtwitter.com/api/v1/statuses/66086667665361546057575456595857606161555458565666 (which does work).

No idea how discord is working with this? Unless they have special handling to derive the API url themselves.

arenasys avatar Jun 06 '25 18:06 arenasys

Correct—Discord is manually calling the API instead of fetching the url itself. It also only accepts numbers and does not pass through other information like query strings, which is why we use https://github.com/FxEmbed/FxEmbed/blob/main/src/helpers/snowcode.ts so we can encode other flags.

I wouldn't recommend trying to use the activity endpoints directly though, you should use our API instead: https://api.fxtwitter.com

We are using the same API internally so there isn't a benefit to scrapping using the activity endpoint

dangeredwolf avatar Jun 09 '25 00:06 dangeredwolf

Not looking to integrate with FxEmbed specifically, just activity embed support. Since it would be nice to have the extra styling and link information that the activity embed provides.

Why not add a handler so the activity endpoint that's given is actually functional, idk what purpose it has being broken and needing special handling.

arenasys avatar Jun 09 '25 10:06 arenasys

Difference between normal and activity embed. Image Image

arenasys avatar Jun 09 '25 10:06 arenasys