<?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>Fan&#039;s blog &#187; doubanclient</title>
	<atom:link href="http://fkpwolf.net/tag/doubanclient/feed/" rel="self" type="application/rss+xml" />
	<link>http://fkpwolf.net</link>
	<description>无为而无不为</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:15:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>豆瓣手机客户端：“煮豆” 第二个版本</title>
		<link>http://fkpwolf.net/2010/02/08/douban-client-second-edition/</link>
		<comments>http://fkpwolf.net/2010/02/08/douban-client-second-edition/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:04:09 +0000</pubDate>
		<dc:creator>Fan Fan</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[doubanclient]]></category>

		<guid isPermaLink="false">http:///?p=630</guid>
		<description><![CDATA[主要是作了些页面上的调整，模仿m.flickr.com加上了标签，所以页面风格是google reader + flickr mobile，融合的还有点生硬，这种照抄过来的，坦白的说，我看的都有点恶心。另外添加了“搜索”这个比较常用的功能。其他倒没啥，欢迎批评指正。 总算在春节回家前改好了，因为明天晚上回武汉的火车，所以改的比较匆忙。回家结婚去了，哈哈，也预祝各位春节快乐！]]></description>
			<content:encoded><![CDATA[<p>主要是作了些页面上的调整，模仿m.flickr.com加上了标签，所以页面风格是google reader + flickr mobile，融合的还有点生硬，这种照抄过来的，坦白的说，我看的都有点恶心。另外添加了“搜索”这个比较常用的功能。其他倒没啥，欢迎批评指正。</p>
<p>总算在春节回家前改好了，因为明天晚上回武汉的火车，所以改的比较匆忙。回家结婚去了，哈哈，也预祝各位春节快乐！</p>
<p><img class="alignnone size-full wp-image-631" style="border: 1px solid black;" title="device" src="http://fkpwolf.net/WordPress/wp-content/uploads/2010/02/device.png" alt="device" width="320" height="480" /></p>
<p><img class="alignnone size-full wp-image-632" style="border: 1px solid black;" title="device2" src="http://fkpwolf.net/WordPress/wp-content/uploads/2010/02/device2.png" alt="device2" width="320" height="480" /></p>
]]></content:encoded>
			<wfw:commentRss>http://fkpwolf.net/2010/02/08/douban-client-second-edition/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby method cache</title>
		<link>http://fkpwolf.net/2010/01/26/ruby-method-cache/</link>
		<comments>http://fkpwolf.net/2010/01/26/ruby-method-cache/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 06:49:14 +0000</pubDate>
		<dc:creator>Fan Fan</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[doubanclient]]></category>

		<guid isPermaLink="false">http:///?p=605</guid>
		<description><![CDATA[场景是这样的：我写的手机客户端要从豆瓣上取出当天最受欢迎的书评和影评，这些数据我是到douban.com相关页面上抓取的，大概有20条数据；然后我在这20条数据中随机取出6条显示到手机客户端 Rails内置几种cache机制：1.Page Cache &#8211; Fastest, 2.Action Cache &#8211; Next Fastest, 3.Fragment Cache &#8211; Least Fastest, 4.ActiveRecord Cache &#8211; Only available in Edge Rails 。从前端到后端，这几种cache机制粒度都不同，但是都不能满足我的需求。page cache会使每次返回同样的页面，这样达不到“随机”的效果。我希望是这样的： def get_pop_list fetch_reviews.random   render... end def fetch_reviews {1...20} end 我只希望get_reviews这个方法返回的结果是cache的，Action cache好像符合，实验一番后无果，这里的action是指rails中的controller而不是一般的method。 google了下找到了这里，刚好满足我的需求：对method的cache。参考这里例 子: require 'caches.rb' class Spider extend Caches def self.fetch_reviews puts "---fetch_reviews" Time.now end class_caches :fetch_reviews, :timeout =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>场景是这样的：我写的<a href="http://zudou.net">手机客户端</a>要从豆瓣上取出当天最受欢迎的书评和影评，这些数据我是到douban.com相关页面上抓取的，大概有20条数据；然后我在这20条数据中随机取出6条显示到手机客户端</p>
<p>Rails内置<a href="http://www.javaeye.com/wiki/Rails-EveryDay/1160-Rails%20Cache">几种cache机制</a>：1.Page Cache &#8211; Fastest, 2.Action Cache &#8211; Next Fastest, 3.Fragment Cache &#8211; Least Fastest, 4.ActiveRecord Cache &#8211; Only available in Edge Rails 。从前端到后端，<a href="http://www.ibm.com/developerworks/cn/web/wa-rails1/">这几种</a>cache机制粒度都不同，但是都不能满足我的需求。page cache会使每次返回同样的页面，这样达不到“随机”的效果。我希望是这样的：</p>
<pre class="brush:ruby">def get_pop_list
  fetch_reviews.random
  render...
end

def fetch_reviews
  {1...20}
end</pre>
<p>我只希望get_reviews这个方法返回的结果是cache的，Action cache好像符合，实验一番后无果，这里的action是指rails中的controller而不是一般的method。</p>
<p>google了下找到了<a href="http://github.com/yrashk/caches.rb">这里</a>，刚好满足我的需求：对method的cache。参考这里<a href="http://blog.zmok.net/articles/2008/01/29/utilizing-caches-rb-with-ferret">例 子</a>:</p>
<pre class="brush:ruby">require 'caches.rb'
  class Spider extend Caches
	def self.fetch_reviews
        	puts "---fetch_reviews"
	        Time.now
	end

	class_caches :fetch_reviews, :timeout =&gt; 10.minutes
  end</pre>
<p>这里只是一个测试的类，当我们调用Spider.fetch_reviews时，得到的时间每次都是一样的，10分钟后值会刷新，有了timeout我也不用写cron程序来刷新cache了。这个method cache可以对参数cache：不同的参数值会有不同的cache，这个倒是很方便，因为这是一个静态方法，不可避免的要传参数。这点和Page Cache的分页处理倒类似。<span style="text-decoration: line-through;">一个要注意的是在development模式下，controller用load &#8220;spider&#8221;或者不显示引用（默认为load）不能达到cache的测试效果。</span></p>
<p>用Java的单例模式来完成这个任务也不太难，这里的self.fetch_reviews也是类的静态方法。不同的是ruby的做法让cache更加透明：加上或者去掉class_caches :fetch_reviews即可改变cache模式，客户端代码不用改变。</p>
]]></content:encoded>
			<wfw:commentRss>http://fkpwolf.net/2010/01/26/ruby-method-cache/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>模仿Google Reader的豆瓣手机客户端：“煮豆”</title>
		<link>http://fkpwolf.net/2010/01/14/zudou-a-douban-client-like-google-reader/</link>
		<comments>http://fkpwolf.net/2010/01/14/zudou-a-douban-client-like-google-reader/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 02:43:13 +0000</pubDate>
		<dc:creator>Fan Fan</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[doubanclient]]></category>

		<guid isPermaLink="false">http:///?p=578</guid>
		<description><![CDATA[一直觉得Google Reader做的不错，Ajax的特则很适合用手机用户：比如bookmark一条记录不用刷新页面，这个对pc来说不是很关键，但是手机网路慢而且不稳定，可能一次刷新页面就再也回不去了，而用户前面一个页面还没有看完，所以“异步”对手机来说很重要。 于是有个这个山寨版的“Google Reader”- zudou.net，也可以说是向Reader致敬吧。主要特征就是“折叠式”的页面显示，我觉得Yahoo UI Pattern应该把这个加入它的库中。 主要功能有： 1）摘取douban主页上面的最受欢迎的书评和影评信息（还没有加上cache功能）； 2）显示评论的详细信息，也可以收藏评论的书或电影，暂时还没有回应评论的功能，好像douban API还没有看放这个功能； 3）发表广播和现实友邻广播。 适合的客户端为：Android, iPhone。 1.15 add: 惊闻Google欲退出中国，痛心！何处为安身立命之所！向Google致敬！ 1.15 add: 这个功能为什么不加入到Google Reader中呢？因为我想豆瓣也有“最流行书评”的RSS Feed，当热也可以加到Reader中，不过，Reader的“收藏”功能不能收藏豆瓣的书籍，或者说收藏功能只是在Reader中有效（评论也只能在reader的圈子中交流，这里Reader是一个信息孤岛）。douban API的有点像基于“RSS协议”的API，能否做个reader的插件（假如reader用这个功能），当在reader中操作时，可以反映到各个RSS的源，这样想发表评论也不用到真实页面去发表了？操作性比较差，很多网站都要登录后才能发表评论&#8230; 1.16 add:iPhone模拟器上的截屏]]></description>
			<content:encoded><![CDATA[<p>一直觉得Google Reader做的不错，Ajax的特则很适合用手机用户：比如bookmark一条记录不用刷新页面，这个对pc来说不是很关键，但是手机网路慢而且不稳定，可能一次刷新页面就再也回不去了，而用户前面一个页面还没有看完，所以“异步”对手机来说很重要。</p>
<p>于是有个这个山寨版的“Google Reader”- <a href="http://www.zudou.net">zudou.net</a>，也可以说是向Reader致敬吧。主要特征就是“折叠式”的页面显示，我觉得<a href="http://developer.yahoo.com/ypatterns/">Yahoo UI Pattern</a>应该把这个加入它的库中。</p>
<p>主要功能有：</p>
<p>1）摘取douban主页上面的最受欢迎的书评和影评信息（还没有加上cache功能）；</p>
<p>2）显示评论的详细信息，也可以收藏评论的书或电影，暂时还没有回应评论的功能，好像douban API还没有看放这个功能；</p>
<p>3）发表广播和现实友邻广播。</p>
<p>适合的客户端为：Android, iPhone。</p>
<p><img class="alignnone size-full wp-image-579" title="zudou1" src="http://fkpwolf.net/WordPress/wp-content/uploads/2010/01/zudou1.png" alt="zudou1" width="320" height="480" /></p>
<p><img class="alignnone size-full wp-image-580" title="zudou2" src="http://fkpwolf.net/WordPress/wp-content/uploads/2010/01/zudou2.png" alt="zudou2" width="320" height="480" /></p>
<p><strong>1.15 add</strong>: 惊闻Google欲退出中国，痛心！何处为安身立命之所！向Google致敬！</p>
<p><strong>1.15 add</strong>: 这个功能为什么不加入到Google Reader中呢？因为我想豆瓣也有“最流行书评”的RSS Feed，当热也可以加到Reader中，不过，Reader的“收藏”功能不能收藏豆瓣的书籍，或者说收藏功能只是在Reader中有效（评论也只能在reader的圈子中交流，这里Reader是一个信息孤岛）。douban API的有点像基于“RSS协议”的API，<span style="text-decoration: line-through;">能否做个reader的插件（假如reader用这个功能），当在reader中操作时，可以反映到各个RSS的源，这样想发表评论也不用到真实页面去发表了？</span>操作性比较差，很多网站都要登录后才能发表评论&#8230;</p>
<p><strong>1.16 add</strong>:iPhone模拟器上的截屏</p>
<p><img class="alignnone size-full wp-image-587" title="zudou-iphone" src="http://fkpwolf.net/WordPress/wp-content/uploads/2010/01/zudou-iphone.png" alt="zudou-iphone" width="481" height="322" /></p>
]]></content:encoded>
			<wfw:commentRss>http://fkpwolf.net/2010/01/14/zudou-a-douban-client-like-google-reader/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

