# Instagram oneboxing

**URL:** https://meta.discourse.org/t/instagram-oneboxing/69099
**Category:** Feature
**Created:** [30 أغسطس 2017، 9:06م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099 "2017-08-30T21:06:12Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [23 أبريل 2018، 11:26ص UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/48 "2018-04-23T11:26:14Z")

</div>

Width is calculated in CSS via:

> <https://github.com/discourse/discourse/blob/597330ad1dd813ad0afa0baad68fdd54baac1390/app/assets/stylesheets/common/base/onebox.scss#L167>

PR welcome for any improvements here. 🙂

---

<div class="post-metadata">

### Author: ![Gard\_Eiklid](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gard_eiklid/32/106812_2.png) [@Gard\_Eiklid](https://meta.discourse.org/u/Gard_Eiklid)
#### Post date: [2 مايو 2018، 1:22م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/49 "2018-05-02T13:22:30Z")

</div>

Hey guys, love the new changes to how instagram links are displayed. Only one small thing that’s bugging me. I just posted a list of instagram profiles on my forum and the list looks horrible since the profile pick gets blown up to the size of the posts above. Any fix for this?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2 مايو 2018، 2:45م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/50 "2018-05-02T14:45:49Z")

</div>

> [@Gard\_Eiklid](#):
>
> I just posted a list of instagram profiles on my forum and the list looks horrible since the profile pick gets blown up to the size of the posts above.

Yeah this isn’t great… the preview in the composer doesn’t match what’s posted either. Example link:

> **[James Jean (@jamesjeanart) • Instagram photos and videos](https://www.instagram.com/jamesjeanart/)**
>
> 1M Followers, 1,458 Following, 4,452 Posts - See Instagram photos and videos from James Jean (@jamesjeanart)

---

<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: [2 مايو 2018، 11:21م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/51 "2018-05-02T23:21:08Z")

</div>

So the bug report is that instagram _profile_ links should be handled differently cc @techAPJ

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [3 مايو 2018، 11:42ص UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/52 "2018-05-03T11:42:03Z")

</div>

Fixed via:

[https://github.com/discourse/onebox/commit/767df71e3087a1b6fb649fda7c548a4953b88323](https://github.com/discourse/onebox/commit/767df71e3087a1b6fb649fda7c548a4953b88323)

Instagram profile links will now be oneboxed using generic oneboxer. Demo:

> **[William Shatner (@williamshatner) • Instagram photos and videos](https://www.instagram.com/williamshatner/?hl=en)**
>
> 433K Followers, 42 Following, 883 Posts - See Instagram photos and videos from William Shatner (@williamshatner)

---

<div class="post-metadata">

### Author: ![cmwebdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmwebdev/32/122368_2.png) [@cmwebdev](https://meta.discourse.org/u/cmwebdev)
#### Post date: [4 يونيو 2018، 6:16ص UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/53 "2018-06-04T06:16:51Z")

</div>

Is it possible to have the Instagram onebox display the entire text description instead of what it currently does, which is roughly only the first sentence? The regular instagram embed shows the full description.

---

<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: [4 يونيو 2018، 7:50ص UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/54 "2018-06-04T07:50:29Z")

</div>

For an Instagram profile? What are you talking about? Example please?

---

<div class="post-metadata">

### Author: ![cmwebdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmwebdev/32/122368_2.png) [@cmwebdev](https://meta.discourse.org/u/cmwebdev)
#### Post date: [4 يونيو 2018، 8:00ص UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/55 "2018-06-04T08:00:44Z")

</div>

Sorry, the correct term is “caption” not description. I’m talking about how the entire caption is displayed when you use their embed code. See here:

 ![instagram-embed](https://global.discourse-cdn.com/meta/original/3X/3/9/39d9b6d47c571f40dff8a0b9bc438f60fff0fbd3.jpg)

---

<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: [4 يونيو 2018، 8:55ص UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/56 "2018-06-04T08:55:57Z")

</div>

That’s practically a novella. Maybe behind a “read more…” button perhaps.

---

<div class="post-metadata">

### Author: ![cmwebdev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmwebdev/32/122368_2.png) [@cmwebdev](https://meta.discourse.org/u/cmwebdev)
#### Post date: [4 يونيو 2018، 2:33م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/57 "2018-06-04T14:33:10Z")

</div>

Ya that was a lengthy example. The main point of the request is so that they don’t have to load another page to read the caption.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [23 أغسطس 2018، 7:58م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/58 "2018-08-23T19:58:14Z")

</div>

I found this thread while searching for a reason as to why any embedded Instagram videos refuse to play after a day or so of being embedded.

Prime example, the video [in post # 30](https://meta.discourse.org/t/instagram-oneboxing/69099/30) here no longer plays 🤔

For a more public example, [an entire thread of Instagram videos on our Discourse](https://greyarro.ws/t/not-mine/2893) have also stopped working.

Should I raise this as a Discourse bug in a new thread?

Or, and what’s _far_ more likely, is this a known Instagram issue? 🤔

---

<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: [23 أغسطس 2018، 8:50م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/59 "2018-08-23T20:50:29Z")

</div>

Instagram, being a part of Facebook, is likely a bunch of jerks – so it wouldn’t surprise me if they use time limited keys for video sharing so they never work forever?

Alternately make sure the correct public URL is used for the videos. I don’t use Instagram myself so I can’t help much.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [23 أغسطس 2018، 9:18م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/60 "2018-08-23T21:18:06Z")

</div>

Hey @codinghorror

We did a few tests on our site in the ‘staff’ area.

If we post the exact same Instagram link (to a single Instagram post) in a new thread, the video plays fine. While playing fine in the new post, it still refuses to play in it’s original post location.

The second test we did was on post editing. We edited a post which had a video that no longer worked. Editing the post somehow made the video playable again!

Would appreciate guidance on if I should post this as a Discourse bug?

But:

> [@codinghorror](#):
>
> Instagram, being a part of Facebook, is likely a bunch of jerks

Amen to that my brother 👍

We might be chasing our tails forever 🙁

---

<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: [23 أغسطس 2018، 9:20م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/61 "2018-08-23T21:20:28Z")

</div>

Not sure. Here’s a public instagram video I found by searching in Google.

[https://www.instagram.com/p/BjakLe4HEYf](https://www.instagram.com/p/BjakLe4HEYf)

See if this video keeps working. `https://www.instagram.com/p/BjakLe4HEYf`

---

<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: [23 أغسطس 2018، 10:58م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/62 "2018-08-23T22:58:56Z")

</div>

The above Instagram video seems fine to me, so perhaps it is

- some issue with the specific video you are trying to link

or

- the instagram servers have decided your servers are spamming them with requests and have stopped allowing your server to talk to their server

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [26 أغسطس 2018، 6:17م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/63 "2018-08-26T18:17:53Z")

</div>

Hi @codinghorror

The video you posted _was_ playing fine, but you appear to have the same problem we do on our instance as three days later your video no longer plays either ☹

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [28 أغسطس 2018، 5:49م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/64 "2018-08-28T17:49:02Z")

</div>

Looks like Instagram is expiring links as suspected

If you visit the source file

[https://scontent-sjc3-1.cdninstagram.com/vp/373216f0c59c42208575329e53c848e3/5B818A9E/t50.2886-16/33260336\_2012189805707951\_8892107981315252491\_n.mp4](https://scontent-sjc3-1.cdninstagram.com/vp/373216f0c59c42208575329e53c848e3/5B818A9E/t50.2886-16/33260336_2012189805707951_8892107981315252491_n.mp4)

> URL signature expired

Related info

> <https://stackoverflow.com/questions/47668014/instagram-feed-api-media-url-shows-url-signature-expired/48582513#48582513>

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [28 أغسطس 2018، 8:14م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/65 "2018-08-28T20:14:42Z")

</div>

Blimey…

Thanks @awesomerobot for checking this out.

Looking at the SO article it seems there is no viable solution or suitable workaround at the moment ☹

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [28 أغسطس 2018، 8:49م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/66 "2018-08-28T20:49:48Z")

</div>

Without fully understanding how Instagram are constructing the embedded media URLs over their CDN, would it be possible for Discourse to automatically renew those signatures?

Again, editing a post with an Instagram video magically enables it to work again. As does posting the link to the Instagram video in a new post (even in the same thread!) makes it work again.

I don’t know if this helps, or if this is irrelevant 😊

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [28 أغسطس 2018، 9:22م UTC](https://meta.discourse.org/t/instagram-oneboxing/69099/67 "2018-08-28T21:22:39Z")

</div>

It would take an answer from an Instagram rep to know for certain, but I can think of two things.

1. Instagram is cycling off older URLs so that stale links won’t impact resources.
2. Instagram wants users to be able to share, but not hot-link indefinitely

Having Discourse automatically rebake posts containing Instagram links would impose more work for Discourse. Depending on the reason Instagram has set links up this way, they may not be pleased with Discourse doing this.

I’m thinking that until the reason is known, a better course would be for Discourse to stop oneboxing Instagram links and display them as only links instead. Granted, it would be a loss of a “cool” feature, but better than a broken onebox.

[Previous page](https://meta.discourse.org/t/instagram-oneboxing/69099.md?page=2)

[Next page](https://meta.discourse.org/t/instagram-oneboxing/69099.md?page=4)
