oEmbed + Embed.ly

(Shri) #1

Here’s what I’d like to setup as a plugin.

Not sure where to begin and how this would work. Perhaps this can be done using onebox or something else?

I’d like to be able to create a more generic embedding interface - Onebox is ok, but not in my use case ( lots of links being posted and we want richer descriptions and one single template to rule the all).

First let me get this out of the way - there is a free tier at Embed.Ly which allows 5000 oembed calls. :slight_smile:

With the build in onebox, I get this:

With embedly’s oembed API I get this:

   "description":"Cynics in the local media like to say: there's no such thing as the most absurd, only the more absurd. The Cantonese saying may not translate well, but the message is clear - just when we think we have seen everything, something more bizarre will...",
   "title":"Hong Kong's Latest Epidemic: Ridiculitis",
   "provider_name":"South China Morning Post",

For a facebook video from another thread, I get this:

   "description":"THE \"ZOMBIE APOCALYPSE TRUCK\" -> Dima Koslowski",
   "title":"Dima Koslowski - Timeline | Facebook",
   "author_name":"Dima Koslowski",
   "html":"<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.facebook.com%2Fvideo%2Fembed%3Fvideo_id%3D879922095450656&url=https%3A%2F%2Fwww.facebook.com%2Fdima.koslowski%2Fvideos%2F879922095450656%2F&image=https%3A%2F%2Fscontent.xx.fbcdn.net%2Fv%2Ft15.0-10%2Fs160x160%2F12496571_879937415449124_521787180_n.jpg%3Foh%3Dd435f3b9eade0643e79f6b7f2d6d82b3%26oe%3D5831128A&key=430136d4c9274a4e91e08196f6a76460&type=text%2Fhtml&schema=facebook\" width=\"500\" height=\"400\" scrolling=\"no\" frameborder=\"0\" allowfullscreen></iframe>",

Can someone suggest a few areas I could look at to bring this into discourse?

The API is called using this:


(Jeff Atwood) #2

Not particularly good timing if you look at 1.7 in #releases.

We view this as a core competency so, as with any core competency, we would never outsource it.

(Shri) #3

Just saw that. Thanks.

No clue how you’re going to do this and what the end result would look like and for sure don’t want to tread on core features. I hope you do consider an approach which may allow a developer to override the built in onebox. :slight_smile:

I actually do want to go further and bring in some tagging / entity and term extraction using some services like alchemyapi / semantria / diffbot into the links posted on this forum that I’m looking at developing, so figured this sort of plugin would be a good start for me to learn ruby / discourse at the same time.