How to make a link presentable

Asked

Viewed 113 times

5

How do I "index" a link on a website to display it in a more presentable way? Example of sites/app that do this is Whatsapp, facebook, gmail. For example, in Whatsapp just paste a link and wait a few seconds it takes an image and title of the link and makes it more presentable. If you have any plugin in php, or javascript, or jquery, etc, that does this already helps a lot. I intend to apply this solution in the Php language.

inserir a descrição da imagem aqui

I don’t know if "index" is the correct term, but if someone knows, even English, they can pass the correct term for me to search.

  • 1

    Note the tags in the source code meta name="og:image" and meta property="og:title". Tags contain this type of information.

2 answers

4


The person responsible for generating this information is the content’s own producer. So to do this you need to 'open' the page to the point of reading its source code to get these meta parameters:

But you’re the one who has to assemble a formatted HTML in your own way to display where you want it.

inserir a descrição da imagem aqui

Basically, see the og:title tags, og:Description, og:image e og:url.

Facebook has a tool that allows you to test with any url. Access: https://developers.facebook.com/tools/debug/sharing/

Paste some link there and see the 'indexed' link beyond these read meta tags. See an example with this link http://gifs.splitz.com.br/? p=6921 (that by the way I am myself in GIF rsrs):

inserir a descrição da imagem aqui

1

The name of this is The Open Graph Protocol (http://ogp.me/) Find in Google by "The Open Graph Plugin Protocol" and see what is applicable to what you need.

Find something in here: https://goo.gl/Lhclr6

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.