TIL: Discourse can embed imgur albums and galleries

(Erlend Sogge Heggen) #1

Continuing the discussion from Oneboxing: Albums from imgur get a cute kitten as onebox

We just found this feature by accident on our forum today. Here’s an embedded imgur gallery, simply by entering the link http://imgur.com/a/PWgY0?gallery

So nifty! I dunno if the Discourse devs did something specifically for imgur recently or if it’s just a result of imgur’s new and improved embeds initiative (are they more OpenGraph compatible now?).


In any case, yay for developers!

Imgur embeds broken
(Robin Ward) #2

We’ve supported this for a while. I checked their oembed support for galleries and they produce the nice formatting so I let it through :smile:

(Mik01aj) #3

Looks like it doesn’t work anymore :frowning:


(Arpit Jalan) #4

That’s because:


But I made some changes recently, so it should not be broken anymore…


(Mik01aj) #5

I just checked on http://try.discourse.org/ and it still doesn’t work. I see only the first image form the gallery.

(Arpit Jalan) #6

That’s because Onebox gem version hasn’t been updated after that commit.

@zogstrip can you please update onebox version?

(Régis Hanol) #7



(Arpit Jalan) #8

Imgur albums are not getting (properly) oneboxed anymore… :frowning:

It seems like Imgur changed metadata info recently and there is no way to detect if the link is an image or album by looking at just metadata info.

Previously there used to be multiple twitter metadata image tags to indicate that the link is an album, but they are not present anymore.

The only way to work around is this is to use Imgur API, but the API only allows access to registered application, as per:

This version of the API, version 3, uses OAuth 2.0. This means that all requests will need to be encrypted and sent via SSL/TLS to https://. It also means that you need to register your application, even if you aren’t allowing users to login.

(Arpit Jalan) #9

This is now fixed via:

(@SenpaiMass) #10

I use this link
http://imgur.com/a/tQEj0 i get the first image, but i am not able to scroll over the images.

(Arpit Jalan) #11

Onebox does not support full Imgur Album embed, it only indicates that the link is an Album.

(Jeff Atwood) #12

Looks a bit weird on iPad, the top bar is full width, but the image is not?

(Arpit Jalan) #16

I noticed that on my MacBook too. Fixed via:


(Leo) #17

This no longer works? It is throwing 404 error, and prints the url as it is

(Jeff Atwood) #18

Can you repro this @jomaxro?

(Joshua Rosenfeld) #19

Yep, right here on Meta. Getting a raw link and a 404 console error.

cc @techAPJ

(Gerhard Schlager) #21

It’s fixed on latest.