does any one have an idea about how Facebook read URL and extract title and a text from the page. I got the title but the text?
when you give URL to facebook it returns the title of the page, a small text ,and the images from that page. I want to know how this work or if there is any script I can use to do that. take in mind that the text from the page is the problem.
$url="http://www.studiesinn.com/"; $lines = file($url); $pageSource=''; foreach ($lines as $line_num => $line) { $pageSource.=$line; } $title_str=explode('<title>',$pageSource); $title_str2=explode('</title>',$title_str[1]); //This is your Page Title: $page_title=$title_str2[0]; $desc_str=explode('<meta name="Description" content="',$pageSource); $desc_str2=explode('" />',$desc_str[1]); //This is your page meta description $page_desc=$desc_str2[0]; Take a look on this and refine this code.
thanks i used this http://simplehtmldom.sourceforge.net/ but facebook doesn't get the text from <meta name="Description" it reads the page and give you the text from it.