首页 > 行业资讯 > 正文

seo综合查询php代码,seo查询工具源码下载

SEO综合查询PHP代码及SEO查询工具源码下载
SEO(Search Engine Optimization)即搜索引擎优化,是指通过对网站进行优化,提高网站在搜索引擎中的排名,从而增加网站的流量和曝光度的一种网络营销方式。SEO综合查询工具是一种能够帮助网站管理员和SEO从业者查看网站SEO信息的工具。本文将介绍SEO综合查询PHP代码及SEO查询工具源码下载。
一、SEO综合查询PHP代码
SEO综合查询PHP代码是一种能够帮助网站管理员和SEO从业者查看网站SEO信息的代码。通过输入网站URL,该代码可以查询网站的Alexa排名、Google PageRank、百度权重、收录情况、反链数量、关键词密度等SEO信息。以下是一段SEO综合查询PHP代码示例:
<?php
$url = 'http://www.example.com';
$alexa = file_get_contents('http://data.alexa.com/data?cli=10&dat=s&url='.$url);
preg_match('/]*TEXT=\"([\\d]+)\"/i', $alexa, $a);
$rank = isset($a[1]) ? $a[1] : 0;
$pr = getPR($url);
$bdweight = getBaiduWeight($url);
$bdnum = getBaiduNum($url);
$ggnum = getGoogleNum($url);
$keywords = getKeywords($url);
$density = getDensity($url, $keywords);
echo 'Alexa排名:'.$rank.'
';
echo 'Google PageRank:'.$pr.'
';
echo '百度权重:'.$bdweight.'
';
echo '百度收录量:'.$bdnum.'
';
echo 'Google收录量:'.$ggnum.'
';
echo '关键词:'.$keywords.'
';
echo '关键词密度:'.$density.'
';
function getPR($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, 'http://toolbarqueries.google.com/tbr?client=navclient-auto&ch='.CheckHash(HashURL($url)).'&features=Rank&q=info:'.$url.'&num=100&filter=0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
$pos = strpos($data, \"Rank_\");
if($pos === false){} else {
$pr=substr($data, $pos + 9, 1);
return $pr;
}
}
function getBaiduWeight($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, 'http://www.baidu.com/s?wd='.$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
preg_match('/]*>([\\d]+)/i', $data, $a);
$weight = isset($a[1]) ? $a[1] : 0;
return $weight;
}
function getBaiduNum($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, 'http://www.baidu.com/s?wd='.$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
preg_match('/

]*>([\\d]+)/i', $data, $a);
$num = isset($a[1]) ? $a[1] : 0;
return $num;
}
function getGoogleNum($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/search?q=site:'.$url.'&hl=en');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
preg_match('/

]*>(.+?)/si', $data, $a);
$num = isset($a[1]) ? $a[1] : 0;
return $num;
}
function getKeywords($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
preg_match('/
二、SEO查询工具源码下载
SEO查询工具源码下载是一种能够帮助网站管理员和SEO从业者查看网站SEO信息的工具。通过下载该源码,可以获取到一个完整的SEO查询工具,可以查询网站的Alexa排名、Google PageRank、百度权重、收录情况、反链数量、关键词密度等SEO信息。以下是该工具的下载地址:
http://www.seoquerytool.com/seoquerytool.zip
该工具的使用方法非常简单,只需将下载的源码上传至网站目录中,然后通过访问对应的URL即可使用。
总结:
本文介绍了SEO综合查询PHP代码及SEO查询工具源码下载。通过使用该代码和工具,可以帮助网站管理员和SEO从业者快速、准确地获取到网站的SEO信息,从而进行相应的优化工作,提高网站的曝光度和流量。

猜你喜欢
文章评论已关闭!
picture loss