Onebox for non-Wikipedia MediaWiki sites

(Adam Capriola) #1

I am having trouble getting any MediaWiki site that isn’t Wikipedia to onebox. (I have whitelisted the domains.) I don’t see any OpenGraph or oEmbed tags on MediaWiki-generated pages, but if Wikipedia is supported then I’d think other should be too.

Might I be doing something wrong or is this a feature not yet available?

(Zane Beckman) #2

It looks like this MediaWiki extension will do the trick. If you don’t operate the third party wikis, the administrator of those sites will have to install them.

(Adam Capriola) #3

Wikipedia doesn’t display any og: meta tags though and it works.

(Zane Beckman) #4


I’ll peek at the source when I get a minute, unless someone else can chime in.

(Zane Beckman) #5

It looks like this is the file that does the magic of oneboxing wikipedia pages.

The easiest way to get that working on other wikipedia-like sites would be to add their URIs to the top: matches_regexp(/^https?:\/\/.*wikipedia\.(com|org)/)

(Adam Capriola) #6

Thanks for looking that up. Any idea if file changes would be overwritten whenever I upgrade Discourse?

(Zane Beckman) #7

I think it will be overwritten if you update by rebuilding the docker container, but not if you update from /admin/docker. This is nothing more than a wild-ass guess.

I’ve been successful in getting patches to survive updates by generating a diff file, then adding a line in app.yml applying the patch around the same place where plugins are fetched from git.

(system) #8

(Sam Saffron) #9


It appears that out-of-the-box media wiki is just terrible with providing any kind of metadata. This is a huge shame and should be reported upstream.