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.

1 Like

This was unexpected:

2 Likes

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

1 Like

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:

1 Like

@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

3 Likes

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?

xkcd

Specific to that one perhaps?

This one didnā€™t onebox:
https://scholarlykitchen.sspnet.org/2018/03/15/a-comment-on-klein-et-als-comparing-articles-to-preprints/
Which is a pity, as the thumbnail is good. (Also it is a bit ironic, as it is a website dedicated to publishing.)

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

Articles from https://scholarlykitchen.sspnet.org 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.

1 Like

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.

2 Likes

Tweets from this user:

https://mobile.twitter.com/Saeen

ā€¦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.

Sample:

https://twitter.com/Saeen/status/979459068724117505?s=20

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?

https://mobile.twitter.com/_Saeen_
<https://mobile.twitter.com/_Saeen_>

Thereā€™s probably an HTML character entity way as well:

https://mobile.twitter.com/_Saeen_
https://mobile.twitter.com/%5FSaeen%5F

letā€™s see

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

1 Like

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

image

Note the click counter says ā€œoneā€ there.

1 Like

Not on my machineā€¦ (Firefox on Win8.1)

Image1

ETA - thatā€™s weird, I wasnā€™t zoomed in when I took the screencapā€¦?

Image1