出于众所周知的原因,大墙内多数尚未熟练掌握翻墙技能的孩子们,都看不到
FeedBurner 提供的 FeedCount(

)。很多租用国外主机的博客,比如 Fenng 兄的
DBA Notes,则是通过在服务器端抓取静态图片的办法解决:
http://www.dbanotes.net/feed.gif。那么,租不起国外主机的穷孩子咋办?
Google App Engine 这时候就能派上用场了。写个图片转发小程序,把墙外的 FeedCount 图片转发进来展示即可。步骤如下:
1. 编辑 app.yaml,在 handlers: 后面添加以下两行:
handlers: - url: /feedcount script: feedcount.py
|
2. 新建 feedcount.py:
from google.appengine.api import urlfetch
url = "http://feeds.feedburner.com/~fc/hutuworm?bg=99CCFF&fg=444444&anim=0" result = urlfetch.fetch(url) if result.status_code == 200: print 'Content-Type: image/gif' print '' print result.content
|
3. 更新 App Engine,然后你就可以通过
http://hutux.appspot.com/feedcount 查看墙外的 FeedCount 了。
Google App Engine 允许每个 app 每天免费进出 2 GB 流量,该干啥干啥吧。

