eTag eTag - 2 months ago 19
MySQL Question

what is need to make a custom chat show link preview?

ok i have a custom website and a self built chat system. what I need to know is how to make it show the link preview instead of the plain text link. similar to Skype or Facebook.

edit

what I'm asking is how to use php and mysql and whatever else is needed to add this feature to my chat. I want it so that when someone sends a link in chat it comes up with a preview of the site and not the plain text link they put in

Answer

Facebook reads the link you provide and makes an HTTP request to fetch and parse the HTML of the page.

First it looks for Open Graph tags. If it does not find the given tags it fetches the standard HTML tags like <title> and <meta>.

In any way, you will need to fetch the contents of the given link and parse them.

Comments