<?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>A colourful bubble? &#187; google-reader</title>
	<atom:link href="http://www.paopao.name/tag/google-reader/feed" rel="self" type="application/rss+xml" />
	<link>http://www.paopao.name</link>
	<description>生活 读书 新知</description>
	<lastBuildDate>Wed, 20 May 2009 02:22:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google Reader Widget 插件</title>
		<link>http://www.paopao.name/wordpress/plugin-wordpress/google-reader-widget.html</link>
		<comments>http://www.paopao.name/wordpress/plugin-wordpress/google-reader-widget.html#comments</comments>
		<pubDate>Mon, 08 Oct 2007 13:26:11 +0000</pubDate>
		<dc:creator>paopao</dc:creator>
				<category><![CDATA[插件]]></category>
		<category><![CDATA[google-reader]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.paopao.name/?p=89</guid>
		<description><![CDATA[从暑假开始使用 Google Reader ，最初只是用它最基本的功能——订阅。渐渐地，不再满足于简单阅读，开始使用星标、分享等功能。前几天突然想把我的 Google Reader 的分享内容加到我的侧边栏里... ]]></description>
			<content:encoded><![CDATA[<p>从暑假开始使用 Google Reader ，最初只是用它最基本的功能——订阅。渐渐地，不再满足于简单阅读，开始使用星标、分享等功能。前几天突然想把我的 Google Reader 的分享内容加到我的侧边栏里，于是搜索了一圈，试用了几个插件，最后选定了 <a HREF="http://nothingoutoftheordinary.com/2007/05/26/wordpress-google-reader-widget/" TARGET="_blank" TITLE="Google Reader Widget">Google Reader Widget</a> 这个插件。这个插件带有 widget ，添加方便，而且可以设置显示的方式。</p>
<p>现在本地测试了一下，没什么问题，顺便修改了一下默认的显示设置。但是传到本站却显示不了任何条目。在站点里找到一个error_log文件，里面有如下警告：</p>
<blockquote><p><code>PHP Warning:  file_get_contents() [&lt;a href='function.file-get-contents'&gt;function.file-get-contents&lt;/a&gt;]: URL file-access is disabled in the server configuration in /.../wp-content/plugins/googlereader.php on line 56</code></p></blockquote>
<p>原来我的服务器的php.ini里的设置导致 file_get_contents 函数不能以 URL 作为参数，但是我又无法更改这个设置。好在 WordPress 给我们提供了一个 Snoopy 类来完成这件事，我在 Fanfou Daily 这个插件里也用到了这个类。修改 googlereader.php 的第56行从</p>
<pre class="brush: php;">$stories = file_get_contents($uri);</pre>
<p>修改为</p>
<pre class="brush: php;">require_once ABSPATH.WPINC.'/class-snoopy.php';
$client = new Snoopy();
$headers = &quot;&quot;;
if ( is_array($headers) ) $client-&amp;gt;rawheaders = $headers;
@$client-&amp;gt;fetch($uri);
if ( !($client-&amp;gt;status &amp;gt;= 200 &amp;amp;&amp;amp; $client-&amp;gt;status &amp;lt; 300) ) return false;
$stories = $client-&amp;gt;results;</pre>
<p>这样就可以正常使用了，具体效果见本站侧边栏 ^_^</p>
<p>另外在这个插件页面的留言里有一个使用cURL的解决方案</p>
<img src="http://www.paopao.name/?ak_action=api_record_view&id=89&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.paopao.name/wordpress/plugin-wordpress/google-reader-widget.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

