# Github onebox broken for some link types

**URL:** https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587
**Category:** Feature
**Created:** [February 18, 2017, 10:37am UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587 "2017-02-18T10:37:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [February 18, 2017, 10:37am UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/1 "2017-02-18T10:37:15Z")

</div>

Discourse has really great preview cards for links in general, dropping in a link on a new line (onebox previews).

Recently I’ve found, though, that Github repository links no longer have any previews (I think they had before), while linking to a specific file on Github has. For example posting `https://github.com/resin-io-playground/awesome-resin-io`:

[https://github.com/resin-io-playground/awesome-resin-io](https://github.com/resin-io-playground/awesome-resin-io)

^^ this has no preview (at the time of posting)

But posting a link to a file in the repo, e.g. `https://github.com/resin-io-playground/awesome-resin-io/blob/master/readme.md`:

[https://github.com/resin-io-playground/awesome-resin-io/blob/master/readme.md](https://github.com/resin-io-playground/awesome-resin-io/blob/master/readme.md)

^^ this has proper preview

I know it worked before, because in [our Discourse](https://forums.resin.io/t/an-awesome-list-for-resin-io/555/1) the first link works, looking like this screenshot:

 ![](https://global.discourse-cdn.com/meta/original/3X/4/d/4d0e50ed8f47ea0587d5e4f7a7dc447a42052b00.png)

I suspect it has to do with Github’s recent style changes (as that happened less than a week ago, and the working screenshot is from 14 days ago).

I also think that besides broken repo links, organization links also regressed, but don’t have a previous working example at hand to double-check.

Any thoughts?

---

<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: [February 18, 2017, 10:50am UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/2 "2017-02-18T10:50:07Z")

</div>

As usual, try it on [Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed](http://iframely.com/debug) and see what you get. Remember oneboxes require proper OpenGraph or oEmbed support.

If it worked before, and you’re on the same version of Discourse, then maybe something did change on their end.

---

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [February 18, 2017, 12:36pm UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/3 "2017-02-18T12:36:23Z")

</div>

Since we are on hosted Discourse (on Discourse), I can’t really tell whether the version is the same or not. 😕

[Trying iframely with the first link](http://iframely.com/debug?uri=https%3A%2F%2Fgithub.com%2Fresin-io-playground%2Fawesome-resin-io) (the one that doesn’t have any preview anymore) and[the second](http://iframely.com/debug?uri=https%3A%2F%2Fgithub.com%2Fresin-io-playground%2Fawesome-resin-io%2Fblob%2Fmaster%2Freadme.md) (that still has) gives the same exact result, extracting info seemingly correctly.

> [@codinghorror](#):
>
> […] then maybe something did change on their end.

You mean on Github’s? They seem to have updated their design (styling) as mentioned above, so that might cause issues extracting stuff, but iframely seems to say that at least the part they test for works? (even though I’m not sure if the extracted text/icons are the same as they were presented in the onebox before, or how the iframely test really compares to what the onebox should show)

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [February 18, 2017, 12:50pm UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/4 "2017-02-18T12:50:05Z")

</div>

I’m also seeing problems:

[https://meta.discourse.org/t/start-a-topic-by-pasting-a-link-like-reddit/54071/76?u=chrisbeach](https://meta.discourse.org/t/start-a-topic-by-pasting-a-link-like-reddit/54071/76)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [February 18, 2017, 12:50pm UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/5 "2017-02-18T12:50:21Z")

</div>

Watching the Dev Tools Network Tab, onebox is returning a 404 for the given URL, it seems this isn’t the only URL it is doing that for either.

Does it for the Official Discourse Repo too, the issue is with onebox  
[https://github.com/discourse/discourse](https://github.com/discourse/discourse)

Network Tools info:

General: (user\_id and ip removed intentionally)

```
Request URL:https://meta.discourse.org/onebox?url=https%3A%2F%2Fgithub.com%2Fdiscourse%2Fdiscourse&refresh=true&user_id=snipped
Request Method:GET
Status Code:404 
Remote Address: snipped

```

Query Parameters:

```
url:https://github.com/discourse/discourse
refresh:true
user_id:snipped

```

**Edit:** Looking at this again, I think GitHub broke this. I could have sworn they used to provide og/oembed tags on the Repo landing page, but now it is definitely not there.  
[Welcome to Iframely](https://iframely.com/embed/https%3A%2F%2Fgithub.com%2Fdiscourse%2Fdiscourse)

---

<div class="post-metadata">

### Author: ![imrehg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/imrehg/32/119891_2.png) [@imrehg](https://meta.discourse.org/u/imrehg)
#### Post date: [February 20, 2017, 10:35am UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/6 "2017-02-20T10:35:17Z")

</div>

It seems to me, that it might be more complicated than that…

For example take a specific file from a repo: [discourse/CONTRIBUTING.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/CONTRIBUTING.md) The iframely link says no embed code: [Welcome to Iframely](https://iframely.com/embed/https%3A%2F%2Fgithub.com%2Fdiscourse%2Fdiscourse%2Fblob%2Fmaster%2FCONTRIBUTING.md) but then Discourse itself / onebox happily embeds it:

> <https://github.com/discourse/discourse/blob/main/CONTRIBUTING.md>

If iframely was correct, then neither the repo link, nor the file link would work. But one does and the other doesn’t…

---

<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: [February 20, 2017, 12:53pm UTC](https://meta.discourse.org/t/github-onebox-broken-for-some-link-types/57587/7 "2017-02-20T12:53:26Z")

</div>

Gists have special support and have for a long time. There is generic oembed / opengraph and hard coded special support. Two different things.
