I would like to display a preview for http links that users could enter in my we
ID: 656554 • Letter: I
Question
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?
Explanation / Answer
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).