How to get from the link the name of the site, its description and so forth. ?
How do all these big social networks?
How to get from the link the name of the site, its description and so forth. ?
How do all these big social networks?
These "big social networks" check each link and download meta information on it.
Here, for example, the meta of this page
<meta property="og:type" content="website" /> <meta property="og:image" itemprop="image primaryImageOfPage" content="http://cdn.sstatic.net/ru/img/apple-touch-icon@2.png?v=bc20db47c743&a" /> <meta property="og:title" itemprop="title name" content="Как из ссылки вытянуть мета теги?" /> <meta property="og:description" itemprop="description" content="Как достать из ссылки название сайта, его описание итп. ? Как это делают все эти большие соцсети ?" /> And if these meta tags are not registered on the indicated link, then nothing big "big social networks" will be pulled out of the page.
This is called the Open Graph Protocol.
Read here: http://ogp.me/
<title> ... Simple mortals can do it too. You need to read what is cURL ( php.net/curl ). In a nutshell: your code “enters” the page, reads its source (this is like the browser’s page view source) and analyzes the data received. Searches for these meta and uses them. Here, on RU.SO, there are a lot of questions and answers to these topics. - cyadvertSource: https://ru.stackoverflow.com/questions/467809/
All Articles