<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>生信菜鸟团 &#187; 访客</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/%e8%ae%bf%e5%ae%a2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bio-info-trainee.com</link>
	<description>欢迎去论坛biotrainee.com留言参与讨论，或者关注同名微信公众号biotrainee</description>
	<lastBuildDate>Sat, 28 Jun 2025 14:30:13 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.33</generator>
	<item>
		<title>WordPress博客统计文章阅读次数及访客数并刷访问数</title>
		<link>http://www.bio-info-trainee.com/433.html</link>
		<comments>http://www.bio-info-trainee.com/433.html#comments</comments>
		<pubDate>Sun, 22 Mar 2015 01:01:55 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[访客]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=433</guid>
		<description><![CDATA[需要插件和自己修改主题下面的foot.php代码。 参考 http://jing &#8230; <a href="http://www.bio-info-trainee.com/433.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>需要插件和自己修改主题下面的foot.php代码。</p>
<p>参考 <a href="http://jingyan.baidu.com/article/ae97a646ce37c2bbfd461d01.html">http://jingyan.baidu.com/article/ae97a646ce37c2bbfd461d01.html</a></p>
<p>步骤如下：</p>
<p>1、登陆到wp后台，鼠标移动到左侧菜单的“插件”链接上，会弹出子菜单，点击子菜单的“安装插件”链接</p>
<p>2、WP-PostViews插件显示wordpress文章点击浏览量</p>
<p>在“安装插件”链接页面的搜索框中输入“WP-PostViews”，然后回车</p>
<p>3、WP-PostViews插件显示wordpress文章点击浏览量</p>
<p>在搜索结果页面点击“WP-PostViews”插件内容区域的“现在安装”按钮</p>
<p>4、WP-PostViews插件显示wordpress文章点击浏览量</p>
<p>程序自动下载插件到服务器并解压安装，一直等到安装成功信息出现，然后在安装成功提示页面点击“启动插件”链接。</p>
<p>5、WP-PostViews插件显示wordpress文章点击浏览量</p>
<p>页面会自动跳转到“已安装插件”页面，在已安装插件列表中我们可以看到“Form Manager”插件已经处于启用状态（插件名下是“停用”链接）。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数599.png"><img class="alignnone size-full wp-image-434" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数599.png" alt="Wordpress博客统计文章阅读次数及访客数并刷访问数599" width="554" height="316" /></a></p>
<p>有了这个插件之后，我们的整个网页环境里面就多了一个 the_views()函数，它统计着每个文章的点击数，这样我们之前的网页就能显示点击数了。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数673.png"><img class="alignnone size-full wp-image-435" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数673.png" alt="Wordpress博客统计文章阅读次数及访客数并刷访问数673" width="553" height="188" /></a></p>
<p>这个是我现在用的主题的php代码，把文章用span标记隔开了，而且显示着上面php代码里面的每一个内容包括日期，分类，标签，评论等等</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数742.png"><img class="alignnone size-full wp-image-436" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数742.png" alt="Wordpress博客统计文章阅读次数及访客数并刷访问数742" width="554" height="170" /></a></p>
<p>其中thez-view()这个函数返回的不仅仅是一个访客数，但是我的文章的访客都太少了，所以我写了一个脚本帮我刷一刷流量。</p>
<p>[perl]</p>
<p>use List::MoreUtils qw(uniq);</p>
<p>$page='http://www.bio-info-trainee.com/?paged=';</p>
<p>foreach (1..5){   #我的文章比较少，就42个，所以只有5个页面</p>
<p>$url_page=$page.$_;</p>
<p>$tmp=`curl $url_page`;</p>
<p>#@p=$tmp=~/p=(\d+)/;</p>
<p>$tmp =~ s/(p=\d+)/push @p, $1/eg; #寻找p=数字这样的标签组合成新的网页地址</p>
<p>}</p>
<p>@p=uniq @p;</p>
<p>print &quot;$_\n&quot; foreach @p; #可以找到所有42个网页的地址</p>
<p>foreach (@p){</p>
<p>$new_url='http://www.bio-info-trainee.com/?'.$_;</p>
<p>`curl $new_url` foreach (1..100); #每个网页刷一百次</p>
<p>}</p>
<p>[/perl]</p>
<p>大家可以看到这个网页被刷的过程，从15到21到27直到100<br />
<a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数1231.png"><img class="alignnone size-full wp-image-437" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/03/Wordpress博客统计文章阅读次数及访客数并刷访问数1231.png" alt="Wordpress博客统计文章阅读次数及访客数并刷访问数1231" width="552" height="533" /></a></pre>
<p>大家现在再去看我的网页，就每个文章都有一百的访问量啦！</p>
<p><a href="http://www.bio-info-trainee.com/">http://www.bio-info-trainee.com/</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/433.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
