php 读取 sogourank 与 chinarank信息
function sogourank($domain)
{
$rank = '';
$pr = 0;
$content = get_content('http://www.sogou.com/web?query='.$domain);
if(preg_match(/([0-9]{1,})/, $content, $matches))
{
$pr = intval($matches[1]);
$width = ceil(65*$pr/100);
$rank = '';
}
$rank = ''.$rank.' '.$pr;
return $rank;
}
function chinarank($domain)
{
$rank = '';
$content = get_content('http://www.chinarank.org.cn/detail/info.do?url='.$domain);
if(preg_match(/排名(.*)/, $content, $matches))
{
$p = trim(str_replace('', '', $matches[1]));
$p = explode(
, $p);
if(isset($p[1])) $rank.= ' 今日:'.$p[1];
if(isset($p[2])) $rank.= ' 本周:'.$p[2];
if(isset($p[3])) $rank.= ' 三月:'.$p[3];
}
$rank = ''.$rank.'';
return $rank;
}