Twitter links are no longer oneboxing

AI-generated summary

Twitter links no longer onebox in Discourse due to Twitter blocking OpenGraph access for non-browser clients and deprecating legacy API routes. A recent fix by @jancernik switches to Twitter’s v2 API, but it requires a paid-tier API key to function — which meta.discourse.org and hosted instances now use, restoring oneboxing there. Self-hosted instances without paid keys will likely see no resolution. An alternative is using native Twitter embeds via a theme component, which users confirm works in posts (though not always in the composer). Richie reported the issue, pmusaraj explained the technical causes, and Lilly and Richie confirmed fixes and workarounds. The situation reflects Twitter’s broader restrictions on third-party access, leaving unpaid users without reliable oneboxing.

Having updated to latest this morning (3.1.0.beta5 ( 303fcf303c )), we’re finding that Twitter links are no longer oneboxing:

https://twitter.com/UKDroneClub/status/1670504740096974848

https://twitter.com/discourse/status/1671991935303598082

Also not working here on meta :confused:

3 Likes

Thanks for the report, there are multiple possible issues here.

First, I think Twitter blocked getting tweet info via OpenGraph outright for all non-browser consumers (like bots and crawlers etc.). Multiple people in our team can’t get tweet oneboxes in Whatsapp, Telegram and other apps since a couple of days ago.

Second, last week they announced Deprecation of legacy access tiers in the Twitter API - Announcements - X Developers, for us that means that we can no longer get tweets from the /1.1/statuses/show route.

We added a fix for this yesterday by @jancernik FIX: Use Twitter API v2 for oneboxes and restore OpenGraph fallback (… · discourse/discourse@24c9053 · GitHub – that switches our code to use Twitter’s v2 API, which is the only remaining avenue for getting oneboxes. In our testing it works, but only if the API key is from a paid tier. I just checked, and it looks like here on meta we’re using a free tier API key (we’re working on a fix) and likely why it doesn’t work on your instance.

Note that Jan’s PR added OpenGraph fallback, but as he was working on it, Twitter blocked access to that too. There’s a very good chance that will never work (and we’ll remove the fallback code).

The bottom line is: without paying Twitter for API access, oneboxes might never work. It’s a sad state of affairs.

6 Likes

Thanks for the insight and the very detailed reply @pmusaraj :clap: :bowing_man:

Isn’t it just :sigh: :confused:

2 Likes

I just updated the API keys used on meta, and rebuilt the OP. Tweets now are embedded correctly here (and for clients in our hosting). The issues raised by the OP still apply to self-hosters though.

One alternative option here is to load native Twitter embeds, see this theme component.

4 Likes

thank you for fixing this @pmusaraj - twitter embeds are working as expected on my forum now. :slight_smile:

3 Likes

You mean, to use a paid-for version? :thinking:

1 Like

Yes, we use a paid tier on our hosting.

4 Likes

Sadly that component doesn’t seem to work anymore either :confused:

Results in the same behaviour:

1 Like

Oh wait, sorry, looks like it does work, just not in the composer:

:scream:

1 Like

A few quick tests and this component seems to work great, even with embedded video:

https://twitter.com/MotoGP/status/1672173032930983936

Thanks @pmusaraj :smiley:

1 Like

Do you use the free or paid version?

1 Like

we are hosted by Discourse / CDCK and using the latest beta version

4 Likes

9 posts were split to a new topic: Twitter oneboxes and links broken now that login is required

Further issues discussed at Twitter oneboxes and links broken now that login is required