url link preivew for html textarea

430 Views Asked by At

I am currently trying to implement a textarea in html for entering url links. When a user types in a url and press enter, a link preview should come up just like in Facebook. I am quite sure there would be some kind of plugins or pre-built tool that I can use for such functionality, but I am not sure where to look for. Can someone give me an advice on how to make this work? Thank you.

1

There are 1 best solutions below

0
On

Facebook accomplishes this behaviour by using the Open Graph Protocol. For it to work properly, your target site does need to have the specific Open Graph meta tags like og:title defined (you can find the complete documentation on the page).

If you scroll down to Implementations you will find parsers for those Open Graph meta tags written for different programming languages like PHP or Ruby. However, you will most certainly not be able to parse the needed information with plain html.