Adding favicon, site description and publish date to oneboxes


(Sam Saffron) #1

One thing I noticed in the “slack” version of onebox is that it has a bunch of info on onebox generic that we do not.

vs

Relevant og/html tags:

<link rel="icon" href="http://www.blogsmithmedia.com/www.huffingtonpost.com.au/assets-h4e2c2f72319695bb7776ddc2c3a6b164/favicon.ico?h=cf339f2d96daf6c7aecc6bf0eba0cdac" type="image/x-icon" />
<meta property="og:site_name" content="Huffington Post Australia" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2017-11-14T07:58:00+11:00" />

The publish time is particularly interesting for og:type article, because its news and when it happened makes a big diff. Favicon and nice title are a great little touch.

How do we feel about improving this @codinghorror ?


(Jeff Atwood) #2

Yeah this is a good point

I think adding the publish time and date is the easiest, if it is in the metadata… maybe site name if it is there too, which is easier than pulling <title> … so can we start with that @techAPJ


(Sam Saffron) #3

Title there is: Oldest Winery Found In Eastern Europe After Wine Residue Detected In Jars … we would render it twice if we used title. What we want is og:site_name if it is available instead of the actual site URL.

All changes should be fairly simple, and now that we download onebox images they will not incur any cross site talking after processed for favicon.


(Jeff Atwood) #4

Favicon is going to be much pain and trauma, but I agree on the other two, if the metadata is present, let’s use it… whitelist that metadata. Handle those first @techAPJ then we can deal with favicon foibles later.


(Arpit Jalan) #6

Added site name and published date to generic oneboxes via:

Examples:

http://www.huffingtonpost.com.au/2017/11/13/oldest-winery-found-in-eastern-europe-after-wine-residue-detected-in-jars_a_23275965

https://www.vox.com/videos/2017/11/20/16670266/trucking-eld-surveillance

https://www.theverge.com/2017/11/20/16672600/oneplus-5t-smartphone-android-2017-review


(Sam Saffron) #7

I find the styling of the date somewhat rough, can we try something more along these lines?

Also I kind of wish for a bit more text next to the site title, but maybe its just cause “The Verge” is so short.

@awesomerobot thoughts?

Also how are we localizing dates in onebox now?


(Jeff Atwood) #8

Also we don’t need to know it was published at 9am on November 20th, 2017… I think the date alone is sufficient @techapj.


(Sam Saffron) #9

True, you can keep the full time in the tooltip for a nice touch

Ideally we want “3 days ago” but that is a pretty big technical challenge for small amount of gain


(Jeff Atwood) #10

No, these are baked once, that ‘3 days ago’ would be permanently baked into the post, wouldn’t it? Needs to be an absolute date. I think that’s generally preferable anyway in this case for external data.


(Sam Saffron) #11

Technically we have a post processor that runs live on every post just like @joffreyjaffeux plugin works, but totally agree it’s a pretty big pain to implement and email is a problem even if web is straightforward to solve


(Arpit Jalan) #12

Done via

and

I don’t think we are localizing dates in onebox yet. Will investigate more and reply here.


(Arpit Jalan) #13

Onebox now support favicon as well. Examples:


(Jeff Atwood) #14