2

I would like to display a preview for http links that users could enter in my website.

Depending on the format/provider:

  • links for youtube and vimeo would display the vignette of the videos
  • audio links to spotify media would display album covers
  • link to images resources (imgur and al. and links ending in .jpg or .png) would display a thumbnail (or return the image that I would resize).

I know I can write this myself by parsing the url for the different providers but I would hope to use/contribute an existing javascript library (not unlike onebox that is unfortunantely written for Ruby).

Do you have a recommendation for such a library?

  • At least part of that is covered by Mousover Popup Image Viewer, which is a Greasemonkey/Tampermonkey/Violentmonkey userscript (and thus JavaScript). Works great at least for images – not sure for the rest. But you at least could base on that. Taking a look cannot hurt :) – Izzy Apr 8 '15 at 13:23
  • Thanks for the pointer! – Name is carl Apr 10 '15 at 9:51
2

I found many ways to preview those links.

oEmbed

It's protocol that must be implemented by the content provider (youtube, twitter...) so you can use a unified API

There are big names of board: flickr, youtube, vimeo, embedly, wordpress, scribd... but also it misses the big elephants in the room facebook, twitter...

oEmbed has bindings for jquery, java, .net, ruby, php - well basically everyone

NoEmbed

Aimed at fixing the oEmbed limitations and bringing a lot more content providers into the fold: twitter, imgur, wikipedia...

Embedly

A convenient solution that comes at a price (a free tier is available).

note I haven't used any this solutions yet, so I can't provide real world feedback.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.