function get_baidurank($url) {$data = get_url_content("http://www.aizhan.com/getbr.php?url=$url&style=1");if (preg_match('/<a(.*?)>(d+)</a>/i', $data, $matches)) {$rank = intval($matches[2]);} else {$rank = 0;}return $rank;}
2、获取搜狗Pagerank权重
function get_sogourank($url) {$data = get_url_content("http://rank.ie.sogou.com/sogourank.php?ur=$url");if (preg_match('/sogourank=(d+)/i', $data, $matches)) {$rank = intval($matches[1]);} else {$rank = 0;}return $rank;}
3、获取Alexa Rank排名
function get_alexarank($url) {$data = get_url_content("http://xml.alexa.com/data?cli=10&dat=nsa&ver=quirk-searchstatus&url=$url");if (preg_match('/<POPULARITY[^>]*URL[^>]*TEXT[^>]*"([0-9]+)"/i', $data, $matches)) {$rank = strip_tags($matches[1]);} else {$rank = 0;}return $rank;}
OK,完成!PS:以上的获取函数,361源码都是在帝国CMS的自定义函数中测试。
新闻热点
疑难解答