Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there open-source code for making 'link preview' text and icons, like in facebook? [closed]

In facebook, when you share a link, a neat little preview is created with an image headline, and text excerpt. Here's an example..

Example Link

Does anyone know if there's any open-source code (pref. php & javascript/jquery) that can generate something like this? Or should I just write it myself..

Cheers!

like image 778
Ben Clayton Avatar asked Jan 10 '11 11:01

Ben Clayton


People also ask

How are link previews generated?

An app or social media platform downloads the link content and generates the preview. The receiving app then shows the preview. It doesn't need to open the link, so potentially malicious content hosted on the linked website doesn't reach the user right away.

How do I make a link preview in webapp?

Link previews are usually generated by fetching the URL and parsing meta tags of the page for title and description and image tags for thumbnails. This can be done by making basic GET requests to the URL. This method works when we just want to parse the meta tags and the page is rendered on the server.


1 Answers

Embedly provides a powerful API to convert standard URLs into embedded videos, images, and rich article previews.I Searched and found an easy way to do it.

Just make a Get request to http://api.embed.ly/1/oembed?url=YOUR-URL . You will find everything in json Format.

like image 167
SumairIrshad Avatar answered Oct 11 '22 17:10

SumairIrshad