我的答案正在扩展@AI W使用页面标题的答案。以下是完成他所说的代码。
<?phpfunction get_title($url){ $str = file_get_contents($url); if(strlen($str)>0){ $str = trim(preg_replace('/s+/', ' ', $str)); // supports line breaks inside <title> preg_match("/<title>(.*)</title>/i",$str,$title); // ignore case return $title[1]; }}//Example:echo get_title("http://www.washingtontimes.com/");?>输出值
华盛顿时报-政治,最新消息,美国和世界新闻
如您所见,这并不完全是Google所使用的,因此这使我相信他们可以获得URL的主机名并将其与自己的列表匹配。



