goolge seo优化 关键词排名查询
<?php
$k = trim($_GET['k']);
$u = trim($_GET['u']);
$arrKeywords = explode(",", $k);
for ($ii = 0; $ii < count($arrKeywords); $ii++) {
$outputstr = '';
for ($i = 0; $i < 10; $i++) {
$sourcecode = @file_get_contents("http://www.google.cn/search?num=100&q=" . $arrKeywords[$ii]);
if ($sourcecode) {
break;
}
}
preg_match_all('/<li class=g>(.*?)<cite>(.*?)//', $sourcecode, $urlmatches);
for ($j = 0; $j < count($urlmatches[2]); $j++) {
if (strstr($urlmatches[2][$j], $u)) {
$outputstr.= 1 + $j . ',';
}
}
if ($outputstr <> '') {
echo '<script type="text/http://www.phprm.com">parent.document.getElementById("Googlek' . $ii . '").innerHTML = "' . $outputstr . '";</script>';
} else {
echo '<script type="text/javascript">parent.document.getElementById("Googlek' . $ii . '").innerHTML = "排名100以外";</script>';
}
}本文地址:http://www.phprm.com/code/2e5ce8dea309697c9ac908f4453755e7.html
转载随意,但请附上文章地址:-)