# Onebox default og:type

**URL:** https://meta.discourse.org/t/onebox-default-og-type/52553
**Category:** Bug
**Created:** [November 5, 2016, 4:53pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553 "2016-11-05T16:53:17Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Aymane\_Shuichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aymane_shuichi/32/63024_2.png) [@Aymane\_Shuichi](https://meta.discourse.org/u/Aymane_Shuichi)
#### Post date: [November 5, 2016, 4:53pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/1 "2016-11-05T16:53:17Z")

</div>

Hi !  
I started recently playing with the Onebox gem to see why it wouldn’t Onebox my site: [https://www.avito.ma](https://www.avito.ma).  
I am no ruby developer but I understood that based on the URI , Onebox chooses what engine to use.

I also believe that there is an engine called html which is the default one if the link doesn’t match any predefined engine.

The question I’m asking is : why doesn’t onebox choose the default engine HTML to my website? When I’m debugging the @engine\_class I get nil in the preview class , initialize method.

All answers are much appreciated.  
Thanks you

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 5, 2016, 5:24pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/2 "2016-11-05T17:24:57Z")

</div>

Did you try checking your site in [Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed](http://iframely.com/debug) first?

---

<div class="post-metadata">

### Author: ![Aymane\_Shuichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aymane_shuichi/32/63024_2.png) [@Aymane\_Shuichi](https://meta.discourse.org/u/Aymane_Shuichi)
#### Post date: [November 5, 2016, 5:26pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/3 "2016-11-05T17:26:23Z")

</div>

Of course ! and everything is set correctly  
Please check it out yourself.

> **[Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed](https://debug.iframely.com?uri=https%3A%2F%2Fwww.avito.ma%2Ffr%2Fcasablanca%2Fcamions%2FKia_K2700_Diesel_15673276.htm)**
>
> Check your URL against Open Graph, Twitter Cards, oEmbed specs. See what other apps see.

And this is the url I’m testing

> **[Camions et Engins à vendre - Avito Maroc | Avito Véhicules](https://www.avito.ma/fr/maroc/camions-%C3%A0_vendre)**
>
> Découvrez 1512 annonces pour Camions et Engins à vendre au Maroc, sur Avito.ma ✅ La plateforme numéro 1 de vente et d'achat des biens et services

As you see it’s not oneboxed here neither.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 5, 2016, 7:39pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/4 "2016-11-05T19:39:16Z")

</div>

Not sure, perhaps @zogstrip can advise.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 5, 2016, 9:15pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/5 "2016-11-05T21:15:10Z")

</div>

Open Graph [has **4** required fields](http://ogp.me/) (title, type, image and url). Your website only shows `title` and `image`. Without a type, the onebox doesn’t know what to do.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 5, 2016, 9:53pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/6 "2016-11-05T21:53:32Z")

</div>

Hmm it looks like only “type” is missing, can we infer that **if we have everything else?** Assume a very general type?

```
<meta name="og:description" content="Kia K2700 Modèle 2007 motor bone etae jami accidentie pnawat kamlin jdad zwa9a wahda jaj éLiqtrik + 2 port centralize + mp3 C D dariba 700dh libghh ...">
<meta name="og:title" content="Kia K2700 Diesel à dans Camions | Avito.ma">
<meta name="og:image" content="http://www.avito.ma/images/07/0791523985.jpg"/>

```

ooh also @zogstrip [it says in the spec](http://ogp.me/#types):

> No additional properties other than the basic ones. **Any non-marked up webpage should be treated as og:type website.**

So arguably _we are wrong here_.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 6, 2016, 1:09pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/7 "2016-11-06T13:09:06Z")

</div>

Yeah, I was chatting with @eviltrout about that the other day. With the new whitelist everything, we should use the same approach as Facebook, that tries to fill as many tags as possible (like using `title` tag instead of `og:title` if the last doest exist).

---

<div class="post-metadata">

### Author: ![Aymane\_Shuichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aymane_shuichi/32/63024_2.png) [@Aymane\_Shuichi](https://meta.discourse.org/u/Aymane_Shuichi)
#### Post date: [November 6, 2016, 2:39pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/8 "2016-11-06T14:39:37Z")

</div>

Hi guys,  
No rush, but when are you planning on having this fix ?  
Thank you in advance.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 6, 2016, 9:49pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/9 "2016-11-06T21:49:50Z")

</div>

@zogstrip will reply here when `og:type` inference is in. I see very little risk if the other necessary fields are present.

I suppose we could also safely infer `og:title` as @falco says, using the HTML `<title>` tag, but I am not sure we ever want to infer description or image.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [November 6, 2016, 9:52pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/10 "2016-11-06T21:52:47Z")

</div>

Yeah, inferring can result into some strange results:

> **[Sharing Debugger - Meta for Developers](https://developers.facebook.com/tools/debug/?q=www.discourse.org)**

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 6, 2016, 9:53pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/11 "2016-11-06T21:53:41Z")

</div>

All I see is “log into Facebook”…

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [November 6, 2016, 9:56pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/12 "2016-11-06T21:56:35Z")

</div>

![](https://global.discourse-cdn.com/meta/original/3X/f/b/fbdf409c8bb37133a5370dcc849a5f5f76003d07.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 6, 2016, 9:57pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/13 "2016-11-06T21:57:15Z")

</div>

Aha yes for the root domain we should actually add those tags! Will do tonight.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [November 7, 2016, 9:42pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/14 "2016-11-07T21:42:00Z")

</div>

It works fine now 😉

> **[Voitures à vendre - Avito Maroc | Avito Véhicules](https://www.avito.ma/fr/maroc/voitures-%C3%A0_vendre)**
>
> Découvrez 106696 annonces pour Voitures à vendre au Maroc, sur Avito.ma ✅ La plateforme numéro 1 de vente et d'achat des biens et services

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 7, 2016, 9:46pm UTC](https://meta.discourse.org/t/onebox-default-og-type/52553/15 "2016-11-07T21:46:40Z")

</div>


