<?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; wordpress</title>
	<atom:link href="http://blog.redren.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.redren.com</link>
	<description>Geek and web2.0</description>
	<lastBuildDate>Sun, 14 Mar 2010 12:56:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>读者来信的回复：关于twitter在wordpress博客上的输出问题</title>
		<link>http://blog.redren.com/2009/10/letters-from-the-readers-reply-with-regard-to-twitter-in-the-wordpress-blog-on-the-output-of-the-problem/</link>
		<comments>http://blog.redren.com/2009/10/letters-from-the-readers-reply-with-regard-to-twitter-in-the-wordpress-blog-on-the-output-of-the-problem/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 05:17:09 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[杂七杂八]]></category>
		<category><![CDATA[GFW]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/?p=9204</guid>
		<description><![CDATA[陈杰，
您好，最近工作忙，没有及时回复，抱歉。
关于twitter的个人信息输出到WP上的方法，我博客里提到了两种方法。一种是通过RSS传输，另一种是通过调用Twitter的API来直接读取数据。这两... ]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">陈杰，</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">您好，最近工作忙，没有及时回复，抱歉。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">关于twitter的个人信息输出到WP上的方法，我博客里提到了两种方法。一种是通过RSS传输，另一种是通过调用Twitter的API来直接读取数据。这两种方法需要你对php有一定的了解。如果你不熟悉 php 的话呢，也可以用更简单的方法，就只安装twitter-tools这个插件，也基本上可以实现你的目的。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">关于RSS输出获取个人twitter信息的方法，请点击这里：http://blog.redren.com/2009/08/also-a-personal-information-via-rss-to-twitter-the-output-of-the-php-code-to-your-blog/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">关于直接读取twitter API来调用个人更新的方法，请点击这里：http://blog.redren.com/2009/08/the-use-of-twitter-api-would-be-perfect-for-your-twitter-updates-the-output-to-your-site-pages-php-css/</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">twitter-tools 您可以在google里搜索一下，到处都是的，我这封信里就不提供了。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">关于翻墙：</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">翻墙的方法有很多，理论上，物理隔绝不发生的话，墙是一定可以翻过去的。常用的简单方法如自由门，无界等都很方便，但是这类软件弹出的信息也比较烦，跟CCTV的内容相比，也不见得有多大的真实性。这类软件目前也被封锁的很厉害，如果要用的话，你需要频繁跟着他更新就是了。需要无界的话，你可以在英文版的skype里面加wujie.net这个帐号就可以了。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">另外Tor+Bridge，Skype+GPass，JAP也是蛮好的翻墙方法，使用也比较简单。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">复杂一点的翻墙手段更好用，但需要你有点点动手能力。比如自建GAppProxy。GAppProxy我的博客上也有详细的安装教程，你可以搜索看一下。我觉得一般来说作为一个具有忧患意识的网民，至少需要同时掌握五到六种有效的翻墙手段才能在这样的高压封锁环境中自如地访问需要访问的网站。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">如果你只是想在墙内玩玩twitter的话呢，上述的翻墙手段就有些大材小用了。网上很多自建API的方法可以让你在墙内开开心心的上twitter，这个我的博客也有两篇文章讲过详细的方法，有兴趣的话，你也可以搜一下，看看。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">希望这封信能够帮你在网上实现一点点自由。</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Zane</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2009-10-29</div>
<p><em>你</em><span style="background-color: #ffffff;"><em>好，我看了你博客上关于把TWI信息输出在WP上的文章，我自己也动手试了好几次，但都是没有成功，不知道我是否可以向你请教一下详细的方法？</em></span></p>
<p><span style="background-color: #ffffff;"><em>或者你愿意帮助我的话，你可以把我的TWI信息的源文件写好给发给我吗？</em></span></p>
<p><span style="background-color: #ffffff;"><em>我的推特帐号是×××，如果有必要，你可以向我索要其密码。</em></span></p>
<p><span style="background-color: #ffffff;"><em>另外，我现在没有找到一个翻墙的途径。以前那些方法现在都不可以用了，你可以指引条出路吗？</em></span></p>
<p>回复：</p>
<p><span style="background-color: #ffffff;">您好，最近工作忙，没有及时回复，抱歉。</span></p>
<p>关于twitter的个人信息输出到WP上的方法，我博客里提到了两种方法。一种是通过RSS传输，另一种是通过调用Twitter的API来直接读取数据。这两种方法需要你对php有一定的了解。如果你不熟悉 php 的话呢，也可以用更简单的方法，就只安装twitter-tools这个插件，也基本上可以实现你的目的。</p>
<p>关于RSS输出获取个人twitter信息的方法，请点击这里：<a href="http://blog.redren.com/2009/08/also-a-personal-information-via-rss-to-twitter-the-output-of-the-php-code-to-your-blog/" target="_blank">http://blog.redren.com/2009/08/also-a-personal-information-via-rss-to-twitter-the-output-of-the-php-code-to-your-blog/</a></p>
<p>关于直接读取twitter API来调用个人更新的方法，请点击这里：<a href="http://blog.redren.com/2009/08/the-use-of-twitter-api-would-be-perfect-for-your-twitter-updates-the-output-to-your-site-pages-php-css/" target="_blank">http://blog.redren.com/2009/08/the-use-of-twitter-api-would-be-perfect-for-your-twitter-updates-the-output-to-your-site-pages-php-css/</a></p>
<p>twitter-tools 您可以在google里搜索一下，到处都是的，我这封信里就不提供了。</p>
<p>关于翻墙：</p>
<p>翻墙的方法有很多，理论上，物理隔绝不发生的话，墙是一定可以翻过去的。常用的简单方法如自由门，无界等都很方便，但是这类软件弹出的信息也比较烦，跟CCTV的内容相比，也不见得有多大的真实性。这类软件目前也被封锁的很厉害，如果要用的话，你需要频繁跟着他更新就是了。需要无界的话，你可以在英文版的skype里面加wujie.net这个帐号就可以了。</p>
<p>另外Tor+Bridge，Skype+GPass，JAP也是蛮好的翻墙方法，使用也比较简单。</p>
<p>复杂一点的翻墙手段更好用，但需要你有点点动手能力。比如自建GAppProxy。GAppProxy我的博客上也有详细的安装教程，你可以搜索看一下。我觉得一般来说作为一个具有忧患意识的网民，至少需要同时掌握五到六种有效的翻墙手段才能在这样的高压封锁环境中自如地访问需要访问的网站。</p>
<p>如果你只是想在墙内玩玩twitter的话呢，上述的翻墙手段就有些大材小用了。网上很多自建API的方法可以让你在墙内开开心心的上twitter，这个我的博客也有两篇文章讲过详细的方法，有兴趣的话，你也可以搜一下，看看。</p>
<p>希望这封信能够帮你在网上实现一点点自由。</p>
<p>Zane</p>
<p>2009-10-29</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/10/letters-from-the-readers-reply-with-regard-to-twitter-in-the-wordpress-blog-on-the-output-of-the-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress发布RSS实时技术&#8212;RSSCloud</title>
		<link>http://blog.redren.com/2009/09/wordpress-release-rss-real-time-technology-rsscloud/</link>
		<comments>http://blog.redren.com/2009/09/wordpress-release-rss-real-time-technology-rsscloud/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 13:10:46 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[杂七杂八]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/09/wordpress-release-rss-real-time-technology-rsscloud/</guid>
		<description><![CDATA[ 
RSSCloud 是由全球最大的博客系统平台开发商 WordPress 在今天发布的一项全新的技术，它可以让你的Blogging变得更加即时；目前，这项技术已经率先运用在Wordpress.com托管平台中。
RSSCloud 是由Wordpr... ]]></description>
			<content:encoded><![CDATA[<p><img title="rss_cloud" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="371" alt="rss_cloud" src="http://blog.redren.com/wp-content/uploads/2009/09/rss_cloud.jpg" width="480" border="0" /> </p>
<p><a href="http://rsscloud.org/">RSSCloud</a> 是由全球最大的博客系统平台开发商 WordPress 在今天发布的一项全新的技术，它可以让你的Blogging变得更加即时；目前，这项技术已经率先运用在Wordpress.com托管平台中。</p>
<p><a href="http://rsscloud.org/">RSSCloud</a> 是由Wordpress负责开发的一项全新的RSS技术，它可以让你的博客像Twitter一样插上实时的翅膀，而使用该协议的阅读器也将一改传统周期性抓取信息源，变成实时追踪、实时展示源内容的强大利器。这意味着：一秒钟前你刚刚发布完日志，下一秒，别人就已经通过阅读器追踪到了你的这一行为。目前，RSSCloud 这项技术已经率先运用在Wordpress.com托管平台中。据悉，下周，Wordpress团队也将把这一技术整合到开源的Wordpress系统平台上。如果，你是WP的独立用户，并且已经迫不及待的想尝试这一颠覆性的技术，可以下载安装官方推出的<a href="http://wordpress.org/extend/plugins/rsscloud/">RSSCloud插件</a>。（必须RSS的输出网站和 RSS阅读器双方同时支持，否则RSSCloud仍无用武之地）</p>
<p>不会再被任何匪夷所思的实时效果感到惊讶了。是的，也许你已经见识了实时博客的威力—— Google和Friendfeed 联合开发的即时RSS协议<a href="http://code.google.com/p/pubsubhubbub/">Pubsubhubbub</a>早已经被娴熟的运用在了Friendfeed、Blogger.com和Google Reader体系中；而Google阅读器支持RSSCloud协议也只是时间上的问题，并且，我相信这样一个等待的时间并不会很长久。另一方面，我想，RSSCloud的横空出世终于可以让那些仅拿“RSS缺少Twitter的实时性”为论点轻易结论出“RSS已死”的宣扬者们彻底闭嘴了吧——RSS是不会死的，死去的只是因我们才思枯竭的Blogging原动力！相信在不久的将来，借力于Wordpress 庞大的用户覆盖群和RSSCloud强大的技术支撑，即时博客不再是小众圈中的玩物，它甚至会成为互联网流行的下一个引爆点也说不准。</p>
</p>
<p>[via <a href="http://www.showeb20.com/?p=2165" target="_blank">showeb2.0</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/09/wordpress-release-rss-real-time-technology-rsscloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>利用RSS传送，在你的wordpress博客中调用你的Twitter个人更新的新方法</title>
		<link>http://blog.redren.com/2009/07/use-rss-to-send-in-your-wordpress-blog-twitter-call-your-new-method-of-personal-updates/</link>
		<comments>http://blog.redren.com/2009/07/use-rss-to-send-in-your-wordpress-blog-twitter-call-your-new-method-of-personal-updates/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 13:30:47 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[杂七杂八]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/07/use-rss-to-send-in-your-wordpress-blog-twitter-call-your-new-method-of-personal-updates/</guid>
		<description><![CDATA[很多朋友都在用各种插件将自己的Twitter信息显示在自己博客的侧边栏，这些挂件有的是以图片形式体现的，有些是以Flash形式体现的，还有的就是一段Twitter官方提供的js代码。图片和Flash的表现... ]]></description>
			<content:encoded><![CDATA[<p>很多朋友都在用各种插件将自己的Twitter信息显示在自己博客的侧边栏，这些挂件有的是以图片形式体现的，有些是以Flash形式体现的，还有的就是一段Twitter官方提供的js代码。图片和Flash的表现形式美观是美观，但是未必是我们所需要的，有时候这些图片或者Flash的风格未必跟我们的Blog兼容。而js代码能够将你的Twitter信息显示出来的前提是Twitter网站没有被伟大的墙给封掉。 </p>
<p>不幸的是，现在那堵墙的的确确是将我们喜爱的Twitter拒之墙外了。像我这样长期翻墙浏览的人可能一时半会还没注意到这件事情，直到我的读者提醒我，我的博客侧边栏显示速度极为缓慢，我才发现是那段js代码显示不出来造成整个侧边栏加载速度受到了影响。其实解决这个问题早已有比较好的方法，我只是比较懒，没有认真采用。 </p>
<p>我在3月份写了一篇《<a href="http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/" target="_blank"><font color="#0080c0">两个远程调用其他网站的RSS信息的方法</font></a>》，那里面的方法正好可以派上用场。首先，在你的Twitter个人主页的右侧栏下方，找到RSS输出的按钮，点击得到地址。然后按照《<a href="http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/" target="_blank"><font color="#0080c0">两个远程调用其他网站的RSS信息的方法</font></a>》这篇文章提供的方法，将 </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rssclass/rss.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://blog.redren.com/feed/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$rss</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> ReadRSS<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$values</span><span style="color: #339933;">=</span><span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RSS</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># 10 可以改成别的数字，比如5，这是读取feed的条数
</span><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div&gt;&lt;a href=&quot;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot;&gt;<span style="color: #006699; font-weight: bold;">{$value['title']}</span>&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这段代码里的<a href="http://blog.redren.com/feed/">http://blog.redren.com/feed/</a> 改成你刚刚得到的twitter的RSS输出地址，将参数5改成你希望调用的任何条数，然后另存这个文件为twitterstatus.php，再将其上传到你的blog模板文件夹中。 </p>
<p>接下来，打开你博客任意模板文件，在你希望的地方加上这样一句： </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/twitterstatus.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>自己再对div层进行一些个性化地调整。你可以将这段代码加在single.php或者其他模板文件中，任何你希望你的twitter status显示出来的位置。</p>
<p>我的Twitter地址 <a href="http://twitter.com/yeahsky"><font color="#0080c0">http://twitter.com/yeahsky</font></a> 欢迎 follow me。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/07/use-rss-to-send-in-your-wordpress-blog-twitter-call-your-new-method-of-personal-updates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>如何不用翻墙访问自己在wordpress.com上的博客</title>
		<link>http://blog.redren.com/2009/03/how-do-not-have-access-to-your-climbing-over-the-wall-on-the-blog-at-wordpresscom/</link>
		<comments>http://blog.redren.com/2009/03/how-do-not-have-access-to-your-climbing-over-the-wall-on-the-blog-at-wordpresscom/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 14:49:52 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[GFW]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[代理]]></category>
		<category><![CDATA[加密]]></category>
		<category><![CDATA[匿名]]></category>
		<category><![CDATA[隐私]]></category>
		<category><![CDATA[隐身]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/03/how-do-not-have-access-to-your-climbing-over-the-wall-on-the-blog-at-wordpresscom/</guid>
		<description><![CDATA[ 
我们可以访问www.wordpress.com的网站，但是一旦建立了个人博客，用xxx.wordpress.com想访问自己的blog却是找不到服务器了。也就是说GFW把wordpress.com的除了www开头的其他二级域名都屏蔽了。
其实我... ]]></description>
			<content:encoded><![CDATA[<p><img height="330" alt="gfw" src="http://blog.redren.com/wp-content/uploads/2009/03/gfw.jpg" width="480" border="0"> </p>
<p>我们可以访问<a href="http://www.wordpress.com">www.wordpress.com</a>的网站，但是一旦建立了个人博客，用xxx.wordpress.com想访问自己的blog却是找不到服务器了。也就是说GFW把wordpress.com的除了www开头的其他二级域名都屏蔽了。</p>
<p>其实我们ping下<a href="http://www.wordpress.com">www.wordpress.com</a>和xxx.wordpress.com就能发现不同的结果。
<ol>
<li>C:Documents and SettingsAdministrator&gt;ping www.wordpress.com&nbsp;&nbsp;
<li>
<li>Pinging wordpress.com [76.74.254.126] with 32 bytes of data:&nbsp;&nbsp;
<li>
<li>Reply from 76.74.254.126: bytes=32 time=242ms TTL=49
<li>Reply from 76.74.254.126: bytes=32 time=238ms TTL=49
<li>Reply from 76.74.254.126: bytes=32 time=238ms TTL=49
<li>Reply from 76.74.254.126: bytes=32 time=241ms TTL=49</li>
</ol>
<p>而我们ping xxx.wordpress.com的结果却是</p>
<p><span id="more-7631"></span>
<ol>
<li>C:Documents and SettingsAdministrator&gt;ping zauc.wordpress.com&nbsp;&nbsp;
<li>
<li>Pinging lb.wordpress.com [72.233.2.58] with 32 bytes of data:&nbsp;&nbsp;
<li>
<li>Request timed out.&nbsp;&nbsp;
<li>Request timed out.&nbsp;&nbsp;
<li>Request timed out.&nbsp;&nbsp;
<li>Request timed out.&nbsp; </li>
</ol>
<p>所以我们可以很容易发现自己单独域名的博客会全部会转到lb.wordpress.com这个域名下。但是这个IP明显是被GFW给屏蔽掉了。但是看这个域名就知道这个只是前端负载均衡设备的IP。但是其实一般真实设备的IP一般都是在这个真实IP的周围。
<ol>
<li>C:Documents and SettingsAdministrator&gt;ping 72.233.2.59
<li>
<li>Pinging 72.233.2.59 with 32 bytes of data:&nbsp;&nbsp;
<li>
<li>Request timed out.&nbsp;&nbsp;
<li>
<li>Ping statistics for 72.233.2.59:
<li>&nbsp;&nbsp;&nbsp; Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),&nbsp;&nbsp;
<li>Control-C&nbsp;&nbsp;
<li>^C&nbsp;&nbsp;
<li>C:Documents and SettingsAdministrator&gt;ping 72.233.2.57
<li>
<li>Pinging 72.233.2.57 with 32 bytes of data:&nbsp;&nbsp;
<li>
<li>Reply from 72.233.2.57: bytes=32 time=226ms TTL=43
<li>Reply from 72.233.2.57: bytes=32 time=226ms TTL=43
<li>Reply from 72.233.2.57: bytes=32 time=227ms TTL=43
<li>Reply from 72.233.2.57: bytes=32 time=227ms TTL=43
<li>
<li>Ping statistics for 72.233.2.57:
<li>&nbsp;&nbsp;&nbsp; Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),&nbsp;&nbsp;
<li>Approximate round trip times in milli-seconds:&nbsp;&nbsp;
<li>&nbsp;&nbsp;&nbsp; Minimum = 226ms, Maximum = 227ms, Average = 226ms&nbsp; </li>
</ol>
<p>找到可以PING通的IP了，windows系统指需要用记事本修改以下文件，指定下Hosts就可以了。
<ol>
<li>C:WINDOWSsystem32driversetchosts&nbsp;&nbsp;
<li>
<li>72.233.2.57 zauc.wordpress.com&nbsp; </li>
</ol>
<p>[via <a href="http://zauc.wordpress.com/2009/03/08/%e5%a6%82%e4%bd%95%e4%b8%8d%e7%94%a8%e7%bf%bb%e5%a2%99%e8%ae%bf%e9%97%aewordpresscom/">http://zauc.wordpress.com</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/03/how-do-not-have-access-to-your-climbing-over-the-wall-on-the-blog-at-wordpresscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>两个远程调用其他网站的RSS信息的方法</title>
		<link>http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/</link>
		<comments>http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 03:20:40 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/</guid>
		<description><![CDATA[3月15号发了一篇文章《通过RSS将wordpress的最新文章调用到其他网站》，一位朋友问我，RSS远程调用的时候如何取得feed源站点的文章全文，又如何控制feed的输出数量。关于这两个问题我做一下解... ]]></description>
			<content:encoded><![CDATA[<p>3月15号发了一篇文章《<a href="http://blog.redren.com/2009/03/the-adoption-of-rss-will-be-the-latest-wordpress-article-calls-to-other-web/"><span style="color:#21759B">通过RSS将wordpress的最新文章调用到其他网站</span></a>》，一位朋友问我，RSS远程调用的时候如何取得feed源站点的文章全文，又如何控制feed的输出数量。关于这两个问题我做一下解答。</p>
<p>第一，全文输出得看feed源了，若对方提供全文输出，则用一段php代码是可以实现远程的RSS全文显示的。</p>
<p>代码如下：<span id="more-7545"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000088;">$RSSURL</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://feeds2.feedburner.com/redlogpress&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$buff</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$RSSURL</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$buff</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$parser</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">xml_parser_set_option</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span>XML_OPTION_SKIP_WHITE<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span><span style="color: #000088;">$buff</span><span style="color: #339933;">,</span><span style="color: #000088;">$values</span><span style="color: #339933;">,</span><span style="color: #000088;">$idx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$channel_title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;value&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #339933;">&lt;&lt;&lt;</span>__HTML__
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">'content-type'</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/html; charset=UTF-8'</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span><span style="color: #000088;">$channel_title</span><span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">'stylesheet'</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/css'</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">'css'</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.redren.com/themes/reddigi2/style.css'</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>table border<span style="color: #339933;">=</span><span style="color: #0000ff;">'0'</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>tr<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.redren.com/themes/reddigi2/images/logo.jpg'</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>td<span style="color: #339933;">&gt;</span>
<span style="color: #000088;">$channel_title</span>
<span style="color: #000088;">$channel_lastBuildDate</span><span style="color: #339933;">&lt;</span>br<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>td<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>tr<span style="color: #339933;">&gt;</span>
__HTML__<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$in_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$tag</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;tag&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;type&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;value&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$tag</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;item&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$in_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;item&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;EOM
&lt;tr&gt;
  &lt;td colspan='2' class='header'width='400'&gt;
    &lt;a href=&quot;$link&quot;&gt;$title&lt;/a&gt;
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan='2' width='400'align='right'&gt;
    $pubDate
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan='2' width='400'&gt;
    $description
  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;
    &amp;nbsp;
  &lt;/td&gt;
&lt;/tr&gt;
EOM</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$in_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$in_item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;link&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;pubDate&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$pubDate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #339933;">:</span>
                <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #339933;">&lt;&lt;&lt;</span> __HTMLEND__
<span style="color: #339933;">&lt;/</span>table<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span>
__HTMLEND__<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这段代码靠一个css文件控制其输出格式，具体请仔细参阅代码。</p>
<p>第二，控制feed的输出条数，我提供另一种RSS读取的php代码，本例将RSS读取类先给封装一次，然后用传统的模板格式将其显示出来。</p>
<p>封装的RSS类，文件名设定为 rss.class.php，代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> ReadRSS<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$values</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">function</span> ReadRSS<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">=</span><span style="color: #000088;">$url</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">ReadFile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> ReadXML<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$parser</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//建立xml解析器</span>
        <span style="color: #990000;">xml_parser_set_option</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span>XML_OPTION_SKIP_WHITE<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//忽略由空白字符组成的值</span>
        <span style="color: #990000;">xml_parser_set_option</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span>XML_OPTION_TARGET_ENCODING<span style="color: #339933;">,</span><span style="color: #0000ff;">'UTF-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//设置编码，目前只支持ISO-8859-1、US-ASCII 和 UTF-8，也可以不设置，与目标编码一致</span>
        <span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #339933;">,</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">values</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">function</span> RSS<span style="color: #009900;">&#40;</span><span style="color: #000088;">$n</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ReadFile</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ReadXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$in_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$read</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$tag</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;tag&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;type&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;value&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$tag</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;item&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$in_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;item&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$read</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$link</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$read</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pubDate</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$read</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pubDate'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$pubDate</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000088;">$read</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$description</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$in_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
                   <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$n</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$in_item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #339933;">:</span>
                        <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;link&quot;</span><span style="color: #339933;">:</span>
                        <span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;pubDate&quot;</span><span style="color: #339933;">:</span>
                        <span style="color: #000088;">$pubDate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                    <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #339933;">:</span>
                        <span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$read</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>模板代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv='content-type' content='text/html; charset=UTF-8'&gt;
    &lt;title&gt;红人网事&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rssclass/rss.class.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://blog.redren.com/feed/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$rss</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> ReadRSS<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$values</span><span style="color: #339933;">=</span><span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RSS</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># 10 可以改成别的数字，比如5，这是读取feed的条数
</span><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;div&gt;&lt;a href=<span style="color: #006699; font-weight: bold;">{$value['link']}</span>&gt;<span style="color: #006699; font-weight: bold;">{$value['title']}</span>&lt;/a&gt;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>这个模板调用了刚才建立的位于 rssclass 这个文件夹下的 rss.class.php RSS类。</p>
<p>如果你还希望个更简单的方法取得远程RSS信息，并且不在意SEO的效果的话，这里还有一篇通过 Google Ajax API 获取远程Feed信息的几个实例。<a href="http://blog.redren.com/2009/04/the-use-of-some-of-the-google-ajax-api-examples/">http://blog.redren.com/2009/04/the-use-of-some-of-the-google-ajax-api-examples/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>通过RSS将wordpress的最新文章调用到其他网站</title>
		<link>http://blog.redren.com/2009/03/the-adoption-of-rss-will-be-the-latest-wordpress-article-calls-to-other-web/</link>
		<comments>http://blog.redren.com/2009/03/the-adoption-of-rss-will-be-the-latest-wordpress-article-calls-to-other-web/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 17:44:08 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/03/the-adoption-of-rss-will-be-the-latest-wordpress-article-calls-to-other-web/</guid>
		<description><![CDATA[今晚研究如何将wordpress的最新文章进行站外调用，我数据库不是很熟，所以很怕用写数据库的方式进行调用。而且由于数据库的权限问题，通过写数据库的方式进行站外调用也是无法实现的。... ]]></description>
			<content:encoded><![CDATA[<p>今晚研究如何将wordpress的最新文章进行站外调用，我数据库不是很熟，所以很怕用写数据库的方式进行调用。而且由于数据库的权限问题，通过写数据库的方式进行站外调用也是无法实现的。于是转而寻求其他方法，RSS就是一个很好的文章站外调用途径，由于wordpress本身有非常好的RSS输出机制，只要目标网站能够读取wordpress输出的feed，问题就迎刃而解了。</p>
<p>下面，我们将要用到的是一段php的代码，所以要求目标网站的主机支持php，而且目标网站的程序文件后缀要是.php的。</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #666666; font-style: italic;">//RSS源地址列表数组 </span>
<span style="color: #000088;">$rssfeed</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://feeds2.feedburner.com/redlogpress&quot;</span><span style="color: #339933;">,</span> 
<span style="color: #0000ff;">&quot;http://rss.sina.com.cn/news/allnews/sports.xml&quot;</span><span style="color: #339933;">,</span> 
<span style="color: #0000ff;">&quot;http://ent.163.com/special/00031K7Q/rss_toutiao.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//设置编码为UTF-8 </span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type:text/html;charset= UTF-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span>sizeof<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rssfeed</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//分解开始 </span>
<span style="color: #000088;">$buff</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$rss_str</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//打开rss地址，并读取，读取失败则中止 </span>
<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rssfeed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;can not open <span style="color: #006699; font-weight: bold;">$rssfeed</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #000088;">$buff</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span> 
<span style="color: #666666; font-style: italic;">//关闭文件打开 </span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//建立一个 XML 解析器 </span>
<span style="color: #000088;">$parser</span> <span style="color: #339933;">=</span> <span style="color: #990000;">xml_parser_create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//xml_parser_set_option -- 为指定 XML 解析进行选项设置 </span>
<span style="color: #990000;">xml_parser_set_option</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span>XML_OPTION_SKIP_WHITE<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//xml_parse_into_struct -- 将 XML 数据解析到数组$values中 </span>
<span style="color: #990000;">xml_parse_into_struct</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #339933;">,</span><span style="color: #000088;">$buff</span><span style="color: #339933;">,</span><span style="color: #000088;">$values</span><span style="color: #339933;">,</span><span style="color: #000088;">$idx</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//xml_parser_free -- 释放指定的 XML 解析器 </span>
<span style="color: #990000;">xml_parser_free</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$parser</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$values</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #000088;">$tag</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;tag&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$type</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;type&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;value&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> 
<span style="color: #666666; font-style: italic;">//标签统一转为小写 </span>
<span style="color: #000088;">$tag</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;item&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;open&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
<span style="color: #000088;">$is_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;item&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$type</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;close&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
<span style="color: #666666; font-style: italic;">//构造输出字符串 </span>
<span style="color: #000088;">$rss_str</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;a href='&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$link</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' target=_blank&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$is_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span> 
<span style="color: #666666; font-style: italic;">//仅读取item标签中的内容 </span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$is_item</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> 
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;title&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> 
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tag</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;link&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span> 
<span style="color: #666666; font-style: italic;">//输出结果 </span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$rss_str</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</p>
<p>将这一段代码加入到你需要调用的网页上，刷新，你就会看到你的网站上调用了远程的博客文章了。这段代码一共输出了三个feed种子传递的文章信息，当然你也可以对代码进行修改，改成你自己需要的博客feed信息。</p>
<p>update: 《<a href="http://blog.redren.com/2009/03/two-long-distance-calls-to-other-sites-rss-information-methods/"><span style="color:#21759B">两个远程调用其他网站的RSS信息的方法</span></a>》</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/03/the-adoption-of-rss-will-be-the-latest-wordpress-article-calls-to-other-web/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>如何方便地为网站配置.htaccess文件</title>
		<link>http://blog.redren.com/2009/02/how-convenient-for-site-targeted-htaccess-file/</link>
		<comments>http://blog.redren.com/2009/02/how-convenient-for-site-targeted-htaccess-file/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 14:57:43 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/02/how-convenient-for-site-targeted-htaccess-file/</guid>
		<description><![CDATA[ 相信许多站长都知道一个神秘但重要的服务器的配置文件.htaccess（全称 Hypertext Access）。一个配置好的.htaccess文件能够在安全、优化等方面省却站长相当多的麻烦。
那么，具体是什么情况下我... ]]></description>
			<content:encoded><![CDATA[<p><img height="100" alt="htaccess-sign" src="http://blog.redren.com/wp-content/uploads/2009/02/htaccess-sign.jpg" width="150" align="left" border="0"> 相信许多站长都知道一个神秘但重要的服务器的配置文件.htaccess（全称 Hypertext Access）。一个配置好的.htaccess文件能够在安全、优化等方面省却站长相当多的麻烦。</p>
<p>那么，具体是什么情况下我们需要用到.htaccess呢？今天这篇文章将为大家揭开.htaccess的神秘面纱。</p>
<p><strong>1. 访问控制</strong><br />.htaccess能够定义什么人可以访问你的网站，或者访问你网站的哪些页面。默认条件下，web服务器是对任何人都开放浏览权限的，这样，你也许会经常受到一些spam机器人的骚扰，收到大堆的垃圾邮件或者评论。这时，你就需要.htaccess。你可以在.htaccess文件中禁止某个域名或者IP对你网站的访问。</p>
<p>另外，如果你的某些页面包含了敏感内容不希望大家都看得到的话，你还可以在.htaccess里面设置密码（还需要用到另一个文件 .htpasswd），这样，只有得到访问授权的人才可以看到你加密了的页面。这个功能对于多作者博客来说相当有用。</p>
<p><strong>2. 显示自定义404错误页面</strong><br />某些时候，你可能将网站的某些页面做了调整，删除了一些过时的或者错误的内容。然而，你的访问者仍然可能会通过外部链接进入到这些已删除的页面原先的地址。这种情况下，他们看到的将是一个很难看的404页面，这样的页面往往让访问者失去继续浏览你的网站的耐心。如果你有设置过.htaccess的话，那就好办了，配置好的,htaccess文件可以将访问者引导到一个你重新设计过的更加<a href="http://blog.redren.com/2009/01/60-creative-cool-404-error-page-design/"><span style="color: #0000ff">美观的404页面</span></a>上去，客户也许会在你的网站上多待上一会儿。</p>
<p><span id="more-7152"></span>
<p><strong>3. 页面301转向<br /></strong>如果你的网站更换域名或者你调整过你的网页绝对地址的链接结构的话，你一定担心就此失去原来网站的访问量。这次，.htaccess又可以帮到你。在.htaccess文件里设置301永久跳转，不仅可以将访问者带到正确的域名下，还可以将新的地址通知到Google的机器人，以保证原来的页面PR值不会就此丧失。</p>
<p><strong>4. 链接地址改写（伪静态生成）</strong><br />一些程序如wordpress能够很好地处理permalink固定地址的优化问题，但是还有许多程序不能这么聪明地处理页面地址的优化，比如论坛程序就不能。大量数字ID以及动态链接地址，往往不讨好搜索引擎，导致网页排名上不去。这时，用.htaccess改写你的页面地址吧。首先你要保证你的服务器开启了URLRewrite功能，然后在你的.htaccess文件里用正则表达式将你的页面地址改写为伪静态，这样对搜索引擎优化SEO很有好处。</p>
<p><strong>5. 让页面加载的更快，而流量耗费的更少</strong><br />这一点，可能很多站长并不是很清楚。.htaccess还能够为你节省宝贵的带宽（本文的带宽等同于流量），并让你的页面加载得更快。如果你是购买昂贵的特别是限制了带宽的商业空间来放置你的网站的话，我这篇文章简直就是在给你印钞票了。<br />.htaccess让我们有两条途径可以对带宽进行有效的节省<br /><strong>a</strong>. 缓存控制 &#8212; 指定哪些文件会被缓存，以及缓存时间将有多久，这样将减少对数据库的频繁进行查询，从而让页面速度更快，而流量耗费更少。<br /><strong>b</strong>. 页面压缩 &#8212; 压缩你的页面，通常我们熟知的是Gzip压缩方式，通过页面压缩，将信息传送给你的访问者的浏览器，以达到节省带宽占用的目的。</p>
<p>如果我技术不是很强的话，该怎么写我需要的.htaccess文件呢？</p>
<p>本文的最终目的不是希望你在看完这一篇文章之后成为编程高手，实际上我会告诉你一个懒人的办法，用工具或者网站来实现自己的目的。你基本上不需要懂什么编写程序方面的技术，用 <a href="http://htaccesser.apacheblog.de/index-nojs.php"><span style="color: #0000ff">.htaccess file generator</span></a> 这个网站，你可以很轻松地按照自己的要求创建一个.htaccess文档出来。</p>
<p>.htaccess file generator 功能强大。它按照你的需要生成的.htaccess文件是以一段代码的形式提供给你的。将代码复制下来，保存为.htaccess，然后上传到你的服务器中，就好了，一点也不麻烦。</p>
<p>初次使用.htaccess file generator你可能会有点晕头转向，这里我将.htaccess最重要的几个选项列出来，按照这个步骤设置，应该可以满足大多数网站的需要了。</p>
<p><strong>访问控制：</strong></p>
<p><strong></strong><img height="269" alt="htaccess-authenticate" src="http://blog.redren.com/wp-content/uploads/2009/02/htaccess-authenticate.jpg" width="480" border="0"> <br />在这个模块里填写谁可以访问谁不能访问，填IP。</p>
<p><strong>缓存控制：</strong></p>
<p><strong></strong><img height="189" alt="htaccess-cache" src="http://blog.redren.com/wp-content/uploads/2009/02/htaccess-cache.jpg" width="480" border="0"> <br />选择是否进行页面缓存，缓存时间是多久。</p>
<p><strong>404错误页面设置：</strong></p>
<p><img height="202" alt="htaccess-404" src="http://blog.redren.com/wp-content/uploads/2009/02/htaccess-404.jpg" width="480" border="0"> <br />将404错误页面设置为自己定义过的页面。</p>
<p><strong>301永久跳转：</strong></p>
<p><strong></strong><img height="179" alt="htaccess-redirect" src="http://blog.redren.com/wp-content/uploads/2009/02/htaccess-redirect.jpg" width="480" border="0"> <br />如果你网站的目录更换过或者访问地址变了，用这个设置。</p>
<p><strong>生成.htaccess文件</strong></p>
<p><strong></strong><img height="220" alt="htaccess-code" src="http://blog.redren.com/wp-content/uploads/2009/02/htaccess-code.jpg" width="480" border="0"> <br />不要忘记按“Generate htaccess file”，生成你的.htaccess文件。</p>
<p>总结一下，我整篇文章都在说.htaccess是如何地重要，其实它的重要性大家都知道。可能是.htaccess设置太麻烦，害怕一不小心搞得网站瘫痪，所以，据我了解，目前.htaccess的使用率还不是很高。如果你现在还没有为自己的网站配置一个.htaccess来提高页面的表现的话，那看完这篇文章，相信你应该有信心自己编写这个文件了吧。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/02/how-convenient-for-site-targeted-htaccess-file/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>显示wordpress某一栏目的最新文章</title>
		<link>http://blog.redren.com/2009/02/shows-a-section-of-the-latest-wordpress-article/</link>
		<comments>http://blog.redren.com/2009/02/shows-a-section-of-the-latest-wordpress-article/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 03:44:05 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/02/shows-a-section-of-the-latest-wordpress-article/</guid>
		<description><![CDATA[我们一般用以下代码来显示wordpress的最新文章

&#60;h2&#62;Recent Posts&#60;/h2&#62;
&#60;ul&#62;
&#60;?php get_archives&#40;'postbypost', 6&#41;; ?&#62;
&#60;/ul&#62;

但这段代码只能帮助我们进行文章的全站调用，如果... ]]></description>
			<content:encoded><![CDATA[<p>我们一般用以下代码来显示wordpress的最新文章</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;h2&gt;Recent Posts&lt;/h2&gt;
&lt;ul&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_archives<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'postbypost'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;</pre></div></div>

<p>但这段代码只能帮助我们进行文章的全站调用，如果我们希望仅仅从某一个栏目调用最新文章该怎么办呢？</p>
<p>下面一段代码就可以解决这个问题：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;ul&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$recent</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cat=1&amp;showposts=10&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$recent</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$recent</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;li&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/a&gt;&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;</pre></div></div>

<p>代码中cat=1表示从栏目1中进行调用，showposts=10则是调用该栏目前10条记录，你可以将这段代码加入到任何你需要显示该记录的模板文件中。当然，事先你还需要到你的wordpress后台核对一下你的栏目ID号。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/02/shows-a-section-of-the-latest-wordpress-article/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在wordpress首页第一篇文章末尾加上Google广告</title>
		<link>http://blog.redren.com/2009/02/in-wordpress-home-at-the-end-of-the-first-articles-to-add-google-ads/</link>
		<comments>http://blog.redren.com/2009/02/in-wordpress-home-at-the-end-of-the-first-articles-to-add-google-ads/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 03:16:18 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/02/in-wordpress-home-at-the-end-of-the-first-articles-to-add-google-ads/</guid>
		<description><![CDATA[凡是正规一点的SEO网站都会告诉你在一个论坛里，第一个贴子底部的广告位是最值钱的。同理，在Blog首页，第一篇博客文章的底部广告位也是最受访客关注的。如果能在第一篇博客文章地不加... ]]></description>
			<content:encoded><![CDATA[<p>凡是正规一点的SEO网站都会告诉你在一个论坛里，第一个贴子底部的广告位是最值钱的。同理，在Blog首页，第一篇博客文章的底部广告位也是最受访客关注的。如果能在第一篇博客文章地不加上Google广告，我告诉你，那效果绝对是好的不得了的。</p>
<p>下面，针对wordpress，我们来看看是如何在首页第一篇文章底部加上Google广告的：</p>
<p>1. 进入FTP下载你的当前应用的theme主题文件夹中的index.php文件到本地</p>
<p>2. 用文本编辑器打开index.php，找到</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></pre></div></div>

</p>
<p>3. 在它上面加上如下代码：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</p>
<p>4. 接下来找到以如下代码开头的一行</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content</pre></div></div>

</p>
<p>5. 在它的行尾</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>这个标记之后加上</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
– 插入你的google广告代码，当然你也可以插入些别的啥 –
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000088;">$count</span><span style="color: #339933;">++;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</p>
<p>6. 保存index.php上传之服务器
</p>
<p>这串代码将把广告插入到Wordpress的日志中.如果你想把广告放置在第一篇文章和第二篇文章之间,则把第5步的代码放到含有</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content</pre></div></div>

<p>这段代码的”entry”层的</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<p>结束标签的后面。</p>
<p>看效果就看我的博客首页咯 <a href="http://blog.redren.com">http://blog.redren.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/02/in-wordpress-home-at-the-end-of-the-first-articles-to-add-google-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>让你的新wordpress blog快速被搜索引擎索引（转）</title>
		<link>http://blog.redren.com/2009/02/let-your-new-wordpress-blog-quickly-indexed-by-search-engines-to/</link>
		<comments>http://blog.redren.com/2009/02/let-your-new-wordpress-blog-quickly-indexed-by-search-engines-to/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 02:36:07 +0000</pubDate>
		<dc:creator>Zane</dc:creator>
				<category><![CDATA[网络资源]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.redren.com/2009/02/let-your-new-wordpress-blog-quickly-indexed-by-search-engines-to/</guid>
		<description><![CDATA[创建一个没有原创内容的博客并不是一个好主意，如果内容不能被搜索引擎索引则毫无用处。在开始你的wordpress之旅之前，你至少应该写两篇完全原创的有质量的文章，修改你的about页面，安装... ]]></description>
			<content:encoded><![CDATA[<p>创建一个没有原创内容的博客并不是一个好主意，如果内容不能被搜索引擎索引则毫无用处。在开始你的wordpress之旅之前，你至少应该写两篇完全原创的有质量的文章，修改你的about页面，安装contact页面，删除wordpress的默认blogroll连接，安装像WP-SEO或者all in one SEO pack这样的SEO插件，完成所有这些工作后你就可以开始进行让搜索引擎收录你的blog的工作了。<br />
<h5><strong>12个步骤让你的blog被搜索引擎快速收录</strong></h5>
<ol>
<li>创建2个或以上的完全新鲜的原创文章
<li>完整的about，contact页面
<li>创建一个“privacy policy” 页面，通常EBAY和adsense都需要这个。
<li>在下面的几个站点注册你的blog地址[这个步骤可以不要，注册是为了方便以后查询索引内容] <a href="http://www.google.com/webmasters">google webmaster console</a>, <a href="https://siteexplorer.search.yahoo.com/">Yahoo! Site Explorer</a>, and <a href="http://webmaster.live.com/WebmasterManageSitesPage.aspx">MSN Webmaster Tools</a>
<li>在<a href="http://www.technorati.com/">Technorati </a>添加你的blog
<li>充分利用bookmark书签服务
<li>为你的blog创建 <a href="http://www.feedburner.com/">Feedburner Feed</a>
<li>为你的wordpress安装<a href="http://www.filination.com/tech/2007/03/10/wordpress-seo-using-robotstxt-to-avoid-content-duplication/">robots.txt file for Wordpress</a>
<li>添加一个 <a href="http://www.mybloglog.com/">MyBlogLog</a> widgets, <a href="http://www.blogcatalog.com/">BlogCatalog</a> 也很不错
<li>添加 <a href="http://www.entrecard.com/">entreCard</a> widget
<li>利用论坛签名，制作反向连接
<li>利用blog注释制作反向连接 </li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.redren.com/2009/02/let-your-new-wordpress-blog-quickly-indexed-by-search-engines-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
