In facebook, when you share a link, a neat little preview is created with an image headline, and text excerpt. Here's an example..
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!
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With