Onebox all the links!



Come on, that title is intentionally super long to bury the joke at the end. And what about the next time, when 250 chars isn’t enough? Then 300? Then 350? Where do we draw the line on title length other than “not here”?


Looking good!

The steps to get a Mediawiki Oneboxing:

  • Start with an up-to-date Mediawiki. I jumped from an old 1.18 to relatively recent 1.27.3. (The jump from Jesse Raspbian to Stretch.) It was painful, but like taking a band-aid off quick, it was done.
  • Add two extensions: OpenGraphMeta and Description2
  • Wrap the image you want for each page. e.g. {{#setmainimage:TorontoOrg.jpeg}} I borrowed Infobox templates from Wikipedia, so I’ll tweak those to do that for me. Onebox seems to need an image, so I’ll think about what to do when there isn’t one.

I have the feeling that there’s been recent work on the BB side, because this wasn’t working last week. Thanks!

P.S. If you update your Mediawiki, also drop in extension MobileFrontend. Phone users and Google ranking will be happy about it.


I went in and added the #setmainmage to the Infobox Organization, Person and Book. (What a mess. I should update to more recent templates now that I can.)

I’ll need to make sure that there’s at least some text in the body of articles so that there’s a description.


This was unexpected:


Well that is not good, @techAPJ can you check our length limits in the code there?


The google docs description was not getting truncated. Fixed via:

Fix will be deployed here soon. Thanks for bringing this in our notice @Wanderfound. :+1:


@techAPJ also added xxtra onebox fanciness along the top, from left to right: site favicon, proper titles (if the page has a title) and dates next to the title (when date is provided in the metadata, but it typically is on news-y sites).

Like so


This one looks like it should work. Is it the É in the title?

ETA: And now it’s working. odd.


Is it just me, or is the xkcd thing presenting its images with wrong aspect ratio?



Specific to that one perhaps?


This one didn’t onebox:
Which is a pity, as the thumbnail is good. (Also it is a bit ironic, as it is a website dedicated to publishing.)


Per it might be because they offer no text description in oEmbed. There is one in the OpenGraph tags though.


Articles from doesn’t onebox because the site returns error code 403 (Forbidden) after looking at default Onebox user agent “Discourse Forum Onebox v2.0.0.beta4”. Nothing we can do about it except creating a custom onebox agent for them, which I am not so sure about.


Well, I wouldn’t bother, I just thought that since we have this thread for onebox failures and I was sad about that one when I posted it elsewhere that I’d report it here.


Tweets from this user:

…don’t Onebox or autolink properly, because the underscores at the start and end of his username are interpreted as italics rather than text. It should be underscore-saeen-underscore rather than saeen.


Is there a simple way around this problem that I’m missing?


Not sure, but you can use parens to make a proper link. Of course that also negates oneboxing, or maybe oneboxing should treat this case as an acceptable way to onebox?

There’s probably an HTML character entity way as well:

let’s see

yes that works. Sorry this guy has an annoying username :wink:


Is there some way the click counter that works on a plain link can be made to work on these onebox things?

It’s an annoying omission.


It already works, here’s an example


Note the click counter says “one” there.


Not on my machine… (Firefox on Win8.1)


ETA - that’s weird, I wasn’t zoomed in when I took the screencap…?