Abilify For Sale

一直用Stattraq插件来统计Blog的访问信息,使用起来还不错。后来发现,我的Blog上很多关键词都是来自Baidu,而Stattraq根本没有对Baidu的特殊处理,于是Hack一下,让Stattraq也能统计百度的信息。


1)BaiduRobot


在"stattraq.php"的函数"statTraqGetBrowser"中,添加对Baidu Robot的识别(顺便也识别一下Sogou的Robot吧):


Abilify For Sale, [code lang="php"]
}else if(strpos($ua, "Baiduspider") !== false){
$browser_type = ST_BOT;
$s_id = "Baiduspider";
return "Baiduspider";
}else if(strpos($ua, "sohu-search") !== false){
$browser_type = ST_BOT;
$s_id = "SogouBot";
return "SogouBot";
}
?>
[/code]


原理很简单,就是分析HTTP头中的"HTTP_USER_AGENT"信息,负责任的搜索引擎都会给出自己的标志,比如Google的"Googlebot",MSN的"msnbot"等等,对于那些把自己伪装成浏览器的搜索引擎,不统计也罢。


一个需要注意的问题是大小写不能搞错。


然后再修改一下"stattraq-install.php",主要是为了今后的升级:


[code lang="php"]
$sqlQuery = "UPDATE {$tablestattraq} SET user_agent_type=1
WHERE browser = 'Googlebot' OR
browser = 'msnbot' OR
browser = 'Baiduspider' OR
browser = 'SogouRobot' OR
... "
?>
[/code]

2) SE Saturation


在StatTraq的SE Saturation中,可以看到对各个搜索引擎收录你文章的统计,同样,加上百度和Sogou。


在"search_engine_stat.php"中,找到相应的代码段,并添加如下信息:


[code lang="php"]
$baidu = getPageDBResults("Baiduspider", Abilify used for, Abilify description, $date_format, $time_frame, order Abilify no prescription, Where can i order Abilify without prescription, $betweenClause, $orderBy);
$sogou = getPageDBResults("SogouBot", order Abilify from mexican pharmacy, Abilify over the counter, $date_format, $time_frame, no prescription Abilify online, Order Abilify online c.o.d, $betweenClause, $orderBy);

.., Abilify australia, uk, us, usa. Abilify used for, if($baidu)
{
$baidu_count = $baidu->cnt;
}
if($sogou)
{
$sogou_count = $sogou->cnt;
}

...

echo 'Number of Pages Indexed', Abilify schedule. Abilify duration, $google_count . '', Abilify For Sale. $yahoo_count, ordering Abilify online. Abilify recreational, '' . $msn_count, after Abilify. Online buy Abilify without a prescription, '' . Abilify For Sale, $baidu_count . '', fast shipping Abilify. Where can i find Abilify online, $sogou_count . '';
echo 'Number of Pages Not Indexed', buy Abilify from canada. Where can i buy cheapest Abilify online, ($total - $google_count) . '', Abilify For Sale. ($total - $yahoo_count), low dose Abilify. Generic Abilify, '' . ($total - $msn_count), Abilify use. Rx free Abilify, '' . Abilify For Sale, ($total - $baidu_count) . '', Abilify gel, ointment, cream, pill, spray, continuous-release, extended-release. Abilify photos, ($total - $sogou_count) . '';
echo 'Percent Saturation', purchase Abilify. Buy Abilify no prescription, floor(($google_count/$total)*100) . '%', Abilify For Sale. floor(($yahoo_count/$total)*100), doses Abilify work. Buy Abilify online cod, '%' . floor(($msn_count/$total)*100), buy cheap Abilify no rx. Where can i cheapest Abilify online, '%' . Abilify For Sale, floor(($baidu_count/$total)*100) . '%', real brand Abilify online. Abilify trusted pharmacy reviews, floor(($sogou_count/$total)*100) . '%';

.., order Abilify online overnight delivery no prescription.

Baidu.com

http://www.baidu.com/search/url_submit.html
Sogou.com

http://db.sohu.com/regurl/regform.asp?Step=REGFORM&class=

?>
[/code]

显然,这里的"BaiduSpider"和"SogouRobot"就是我们刚才修改的那个函数的返回值。


3)统计用Baidu访问的关键词(Search Team)


在"stattraq.php"的函数"statTraqGetSearchPhrase"中,添加针对Baidu和Sogou的解析:


[code lang="php"]
}else if(strpos($referrer, "baidu.")!== false){
$key = "wd";
}else if(strpos($referrer, "sogou.")!== false){
$key = "query";
?>
[/code]

原理很简单,就是分析referrer中的Query串(Baidu默认是采用GB2312来传递,这个比较烦人)。


比如:



http://www.google.com/search?hl=zh-CN&q=xerdoc&...



"q"就是Key。


Update (2005.11.04)


修改一下StatTraq中文乱码的错误:


1) Summary页面中的乱码:



1.打开/wp-stattraq/reporter/summary.php,找到第140行

<?php echo htmlentities(stripslashes($row->post_title));?> ,修改为

<?php echo htmlentities(stripslashes($row->post_title),ENT_NOQUOTES,’utf-8′);?>


2.打开/wp-stattraq/reporter/query_strings.php,找到第88行

htmlentities($row->search_phrase) ,修改为

htmlentities($row->search_phrase,ENT_NOQUOTES,’utf-8′)


- 解决StatTraq的乱码问题



2) Baidu, Sogou等query串的转码:


用iconv来进行转码


[code lang="php"]
if($gb2312 == true && extension_loaded("iconv"))
$phrase = iconv("gb2312","UTF-8",$phrase);
[/code].

Similar posts: Periactin For Sale. Buy Armour Without Prescription. Buy Ampicillin Without Prescription. Avodart For Sale. Buy Xalatan Without Prescription. Prozac natural. Buy generic Combivent. What is Celexa. Levaquin from canada. Reglan steet value.
Trackbacks from: Abilify For Sale. Abilify For Sale. Abilify For Sale. Abilify For Sale. Abilify For Sale. Generic Abilify. Order Abilify online overnight delivery no prescription. Abilify treatment. Real brand Abilify online. Canada, mexico, india.

Related entries:

4 Responses to “Abilify For Sale”

  1. 数字图书馆前沿问题高级研讨班 » Blog Archive » WP插件:wp-StatTraq Says:

    [...] 一个很好用的访问统计插件:wp-Stattraq,目前的版本是1.0b。目前官方版本只支持google、msn、yahoo!。如果要添加百度、搜狗的支持,可以参考:“Some hacking to support Baidu and Sogou in StatTraq”。 安装好后的访问地址是:StatTraq @ DL-China Tags: none [...]

  2. BunnyQ Says:

    我那stattraq也是自己hack加上的百度 国内搜索引擎应该都是gb2312吧
    所以显示出的文字编码出问题 考虑iconv转换一下..

  3. Meng Yan Says:

    Thanks BunnyQ, yes, it should be “iconv”ed, :-)

  4. Nickcheng.LOG » Blog Archive » WP-StatTraq优化 Says:

    [...] 2. 添加新的搜索引擎 这个统计系统默认只是支持Google, Yahoo和MSN这三个搜索引擎, 而国内的一些搜索引擎就只有我们自己想办法了. 这个链接就给出了解决方法, 不过里面的代码有一点点问题

    1. $baidu_count = 0; $sogou_count = 0;

    http://www.mengyan.org/blog/archives/2005/08/30/59.html   [link] [...]

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post | TrackBack URI