integration in discourse

(FelixA) #1

We need to do a lot of polls on our discourse instance, and at the moment the basic poll functionality discourse itself provides is quite limited. is nice because you also have the possibility to slightly agree/disagree, giving more flexibility.

I wonder if it possible to integrate this functionality into discourse and if other users would be interested in this feature as well.

(Erlend Sogge Heggen) #2

Do they support oEmbed? We’ve looked into supporting other poll systems before, but we ran into some roadblocks:

(Travis Kriplean) #3


Creator of here. We don’t currently support oEmbed. To be honest, I had never heard of it. I’ll look into what it would take to implement. Third-party javascript is notoriously difficult to get right.


Edit: looks like oEmbed is not really about third party javascript, which avoids much of the hastle. I think there is a pretty straightforward approach where considerit could provide a small HTML snippet including (1) the name of a proposal, (2) a link to the considerit page for that proposal, and (3) a snapshot of the current histogram representing the opinions on that proposal.

(Jeff Atwood) #4

Either OpenGraph or oEmbed will be perfect, and beneftis the entire web, not just us…

(Travis Kriplean) #5

If I add oEmbed support for considerit, does it require significant effort on Discourse’s end to support embedding considerit? What does the work look like from your end? (Assuming of course that the html considerit returns at its oEmbed endpoint works.)


(Joshua Rosenfeld) #6

@Travis_Kriplean, assuming that the oEmbed endpoint has all the data Discourse uses, the only thing needed for a site to support oneboxing is adding the domain to the onebox whitelist.

(Travis Kriplean) #7

Thanks! Also, thanks for bringing up Onebox. Useful to know about.

(Travis Kriplean) #8

Flipping this around a bit, does Discourse itself act as an oEmbed provider? For example, if I link to a Discourse thread from a Considerit proposal, could I get a nice onebox representation of the activity in the Discourse thread that I can embed on Considerit? I’m looking at the meta data of this thread’s html and I don’t see oEmbed endpoints advertised. It would be great to be able to richly link both ways!

edit: looks like Discourse implements OpenGraph, not oEmbed. Sorry for the spam, still learning about these standards!

(Rafael dos Santos Silva) #9

You can test any website here:

(Travis Kriplean) #10

Every time I post here, I learn something new and useful, from a different person.

(Uwe Keim) #11

Sounds like the Stack Overflow effect :wink:

(Travis Kriplean) #12

Hi again!

I think I have oEmbed working for proposals (JSON oEmbed endpoint example, XML oEmbed endpoint example). Furthermore, these oEmbed endpoints are discoverable in the meta tags of any considerit proposal, as per the oEmbed specs.

Considerit oEmbed endpoints specify a “rich” type, i.e. HTML. This HTML is mostly just an iframe, which of course is nice because it creates a separate execution environment to prevent conflicts with the embedding page. The HTML also loads a small javascript library into the containing window which resizes the iframe whenever the content inside the iframe changes height. The author of this library asserts that the library is engineered to play nicely with the containing window.

For a demonstration, go to Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed, input “Mist GUI with live graphs of proposals/votes”, and view the oEmbed result.

I’d like to test it with Discourse, which I think requires whitelisting considerit proposals. The domain to add is https://*

What is the best way to proceed?

Thanks again,

p.s. @Falco, the testing link to iframely/embed was useful, but it won’t work for domains they haven’t already whitelisted. It led me to Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed though, which worked quite nicely.

p.p.s. I think the first pass at embedding considerit proposal results is already pretty nice…we got histograms!

(cpradio) #13

If you have a sample to use I can whitelist it on my sandbox in a few minutes.

(Travis Kriplean) #15

Do you mean an example url? If so, here’s one: Mist GUI with live graphs of proposals/votes

(Jeff Atwood) #16

Testing with Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed should suffice, as long as it passes there we are usually good!

(cpradio) #17

iframely definitely looks good. :slight_smile:

(Travis Kriplean) #18

Hi folks, any update about the status of getting considerit whitelisted for oneboxing in Discourse?

I did a test at to see if whiteboxing would work. I received a Onebox badge for posting a considerit link, but I never saw a Onebox (though when I examine the link tag in the DOM, it has a Onebox class). I don’t know though if this happens to all links posted in Discourse regardless of whether they are whitelisted as oneboxable or not!


(Sam Saffron) #19

Simplest way to get traction here would be a PR to GitHub - discourse/onebox: A gem for turning URLs into website previews ultimately this is @codinghorror’s call on adding more to the whitelists out-of-the-box.

This is the current default list of oembed/opengraph based whitelist:

(Travis Kriplean) #20


I created a pull request at Adding to onebox whitelist by tkriplean · Pull Request #321 · discourse/onebox · GitHub (cc: @codinghorror)

Please let me know if I should do anything else.


(FelixA) #21

Hi, I tried adding it manually to our whitelist

unfortunately nothing is getting oneboxed - if I paste a link, it just shows the link, but no Iframe is being generated.