Feb 3, 2010

用Google App Engine 实时同步微博以及无障碍上网

Google

如今各类微博以及SNS类网站大行其道,但是实现他们的实时同步却是一个比较棘手的问题。另外互联网的浏览有时在国内并不那么方便,还好用Google App Engine能一次解决这两个问题。虽然GAE是针对开发者的,但是就算是一个什么都不懂的菜鸟(如我)也能借助Google大神来办好这两件事情。

什么是Google App Engine

Google App Engine是Google提供的可扩展系统上构建网络应用程序。每个 Google App Engine 应用程序都可使用多达 500MB 的持久存储空间以及可支持每月 500 万综合浏览量的足够带宽和 CPU。目前每个用户可以免费创建十个应用。(转自月光博客)

下载并安装开发环境

Python 2.6.4 Windows版下载地址 http://www.python.org/download/releases/2.6.4/
Google App Engine SDK 下载地址 http://code.google.com/intl/zh-CN/appengine/downloads.html

同时,请自行用你的Google账号开通GAE(需要用手机接收短信) http://www.appspot.com/
随后在GAE中创建自己的应用程序,其中 Application Identifier 就是你的自定义名称,在下一步要用到。

下载应用程序

1. 同步Twitter到其他微博的程序: 下载源码

  • 解压缩后,请把 app.yaml 中第一行的应用程序名称改成你的自定义名称。
  • 随后更改 twitter.py 中的代码,把你要同步的微博客用户名和密码填上,并在最后一行填写你的Twitter账号。
  • 更具体的修改指导见月光博客的文章

2. 无障碍浏览的程序:下载源码

  • 此代码为我从 http://goo.gl/Fgtg 处下载打包而成。
  • 解压缩后,请把 app.yaml 中第一行的应用程序名称改成你的自定义名称。
  • 把mirror.py 中的

    secure_url = "https://mirrorrr.appspot.com"

    中的mirrorrr改成你的自定义名称

  • 更详细的指导见 戴斌的网站

安装应用程序

首先在GAE里创建修改完下载好的文件后,打开Google App Engine,添加这两个应用程序,用 Deploy 按钮上传到服务器。随后就大功告成了。

安装成功后,GAE就可以实时同步你的Twitter内容到各个微博。另一方面,安装无障碍浏览的程序将使您可以方便的浏览全地球的网站(请用https方式访问,以保证安全)。

Tags:
Post by SUN @ 9:25 pm | 与时俱进 | Comments (4)
Feb 1, 2010

经济类网站的RSS全文输出

rss

前不久用Yahoo的pipe做了 经济学人(Economist) 的RSS全文输出 ,觉得效果不错,现在在加上几个网站的全文rss输出。

南方周末-经济新闻:http://feeds.feedburner.com/znsun/rss/nfzm

BBC 中文网| 金融财经: http://feeds.feedburner.com/znsun/rss/bbc-ef

华尔街日报-要闻及中国股市: http://feeds.feedburner.com/znsun/rss/wsj

这几个全文输出都是也都是用Yahoo pipe做的,因为yahoo pipe的稳定性不太好,所以都再用FeedBurner做了一下中转,并且把Yahoo pipe的源码链接都替换成了相应的网站地址,方便用户浏览 。

Tags:   
Post by SUN @ 8:57 pm | 与时俱进 | Comments (6)
Jan 28, 2010

我为什么用Chrome

Chrome

看到月光博客出了篇新文《我为什么使用Firefox浏览器》,觉得写得有些片面。结合自己的使用感受,我觉得Google Chrome(谷歌浏览器)4.0 还是要优秀很多 (IE这种东西就不用比了)。

1. 速度为王:加载了扩展的Chrome 的速度也比裸奔的 Firefox3.6 的速度要快。而且Firefox不加载各种扩展时的实用性并不强,加载了各种扩展后的Firefox 和 Chrome 更是没法比。这一点,Chrome完胜。

2. 安装扩展方便:Chrome无论是更新,安装扩展都很方便,无需重启,马上就可使用。而火狐的用家都讨厌的就是安装或者更新完扩展后要重启Firefox,有时打开Firefox时,系统检测到有扩展更新,也会跳到更新窗口。可火狐的扩展更新偏偏又是经常的事,这样一来,就很麻烦。这一点,Chrome完胜。

3. 翻墙方便:Chrome虽然不支持socks方式的域名解析,但是结合Privoxy以及Switchy,同样方便快捷。这一点上,Firefox稍微方便些,不用安装Privoxy。这一点,Chrome稍逊。

4. 支持免翻墙推特:Chromed Bird 是Chrome的扩展,支持自定义推特API,有了它,墙只是一个门槛,轻轻一抬脚就跨过去了。而Firefox有Echofon(Twitterfox)万能版,这一点,两者不相上下。

5. IE tab扩展:Chrome和Firefox都有自己的IE tab扩展,这一点,两者也没有区别。

6. 兼容性:Firefox 3.6 虽然在速度上 比 自家的 Firefox 3.5稍快,但兼容性却下降了。 举个简单的例子,由于Firefox3.6弃用getBoxObjectFor 就导致了其和Discuz! 7.2的兼容性出现了问题。但Chrome却没这个问题。这一点,其实也是各有千秋的。

7. 扩展库:Firefox 这么多时间来所积累的扩展库的确比Chrome多些。但是现在常用的Chrome扩展库都有了,且将来只会更多更丰富。我只有在编辑网页的时候才会用Firefox。

综合来看,两款浏览器在其他方面类似的情况下,Chrome的速度优势就显得很难能可贵了。所以我还是推荐用Chrome。

Tags:   
Post by SUN @ 6:29 pm | 与时俱进 | Comments (6)
Jan 27, 2010

不许联想的T恤

Tshirt

大冬天的,还真就干了件反人类的事情-- 跑去不许联想的淘宝店买了两件T恤。

结果老天爷也看不下去了,又是降温又是暴雪,让这两件T恤整整拖了一个月才寄到。

还好三表哥想的周到,送了些蛮有创意的小礼品。在这里卖个关子,想知道是什么礼品的就去淘宝上买吧。衣服的价格稍许贵了点,不过胜在面料尚好,款式独特。所有图案都是网友设计的。尤其是这款变形虫,开卖以后被其他网友揭发此图作者有抄袭嫌疑,所以小峰说卖完这批就不印了,嗯,绝版T恤,绝不撞衫。

里面的T恤适合各类人士,敬请围观。

http://goo.gl/hGxe

---------以上并非收钱的广告贴---------





Post by SUN @ 12:05 pm | 信手涂鸦 | Comment (0)
Jan 21, 2010

进退两难

twocold

之前一直没有订阅韩寒的blog,因为觉得他的人生道路并不“主流”。
慢慢地才明白,其实是我们被“主流”了,自然也就明白这样的人 才是 人才,才是我们这个社会所稀缺的。

他一直喜欢调侃各种囧人,从小四到70码,没有敌手。不过这次他选择了咱中国最彪悍最神秘的群体--“有关部门”。我想这和他之前的杂志被禁止出版有一定的关系--既然平面媒体无法面世,那就选择在网上调侃“有关部门”。诚然,若是公平竞争的话,“有关部门”是必输无疑的。一方有数十万的订阅者和数百万乃至千万的潜在读者;而另一方则如同地下组织,这场对决没有悬念。只可惜这场对决中“有关部门”既是对手又是裁判;打不过了,it就禁止韩寒出场。所以这场好戏还有看头。

韩寒最近的表现对“有关部门”来说是个难题。万一把韩寒逼急了,他到墙外开个博客,这样一定会大大推动某项技能的普及化,而且这对耗资巨大的神盾来说也是件很可悲的事情。
可不禁止他出场,他会不断的发表“育儿经”,这轰动效应恐怕也不小。

所以 还是让《独唱团》面世吧。

--附韩寒被删文章的blog,需跨长城--

http://twocold-hanhan.blogspot.com

Tags:
Post by SUN @ 2:24 pm | 随笔杂谈 | Comment (0)
Jan 19, 2010

I am just speculating

这是韩寒文章的英文版:
From http://is.gd/6z3E8

中文版见这儿:http://goo.gl/fb/dOF6

德文版见这儿:http://is.gd/6z3mG

"I am just speculating"

[This blog post by China's top blogger was deleted by the blog hosting service Sina.com.]

(Bullock.cn) I am just speculating. By Han Han. January 17, 2010.

2010: China begins an Internet clean-up campaign with the slogan: "If you stop beating someone for 3 days, he/she may get on the roof and remove tiles." (Note: 三天不打,上房揭瓦 is a Chinese saying. When applied to children, the notion is that you beat your child in order to make him/her behave (as in respecting authority, maintaining discipline and being a good citizen) and, conversely, if you don't beat your child, he/she will misbehave. It also applies to wife-beating.)

2010: The relevant department expands the list of banned terms. The Chinese word for "file" (which has the same sound as Party) and the English letter "D" disappear in mainland China. Dangdang was changed to Angang, while Douban became Ouban.

2010 June: The government inaugurates the "Protect the Children" campaign. Children's Day is elevated to the same status as National Day. It is also announced that all information that is unfavorable to the healthy development of children and adolescents will be strictly prohibited. At the same time, the Shanghai World Expo introduces the slogan "World Expo, World Expo, catch ten thousand adulterous couples in bed" in order to conduct online and offline anti-pornography (anti-"yellow") campaigns simultaneously. The government makes it clear that anything and everything connected to pornography shall be censored because they stand for obscenity and feudalism. Elementary school students are mobilized to march in the streets to demonstrate against anything pornographic ("yellow").

2010 July: The Elementary School Students Patriotic Committee finds out that the five yellow-colored five-pointed stars on the national flag are inconsistent with contemporary progressive ideas. The relevant department decides to change the five-pointed stars from yellow to red.

2010 August: The government discovers that the red five-pointed stars are the same color as the background, so that it is hard to find them. Representatives of elementary school students propose the five-pointed stars be changed into green color, to represent green scarves and Green Dam.

2010: Based upon the recommendations of the Elementary School Students Loving Care Committee and representatives of elementary school students, the government tightens the censorship standards on photographs, with guiding principles such as "erect nipples equal bare nipples."

2010: All Internet forum masters are formally given public service worker status.

2010: The government introduces a brand new Internet Great Wall. This Great Wall system is based upon the collective wisdom of innumerable of experts from all walks of life in China. They work together at a military base. The satellite photos of their work site was misinterpreted by people inside and outside of China as those of an aircraft carrier under construction.

2011 January: The government allocates 100 billion yuan to hire Internet commentators from its next round of economic stimulation package. The pay for Internet commentators rises from 50 cents per post to 1 yuan per post. The target for 2011 is to have 100 billion positive posts. The Fifty-cent Gang members at the various forums weep in gratitude because their long, arduous work over the years has finally allowed them to join the big team. From there on, the ratio of Internet commentators versus normal people is about 50:50 at the large Internet forums.

2011: Google, YouTube, Facebook, Twitter announce that they are re-entering China and opening up registration. At the same time, the aforementioned websites announce from the United States that they are not developing any businesses in China. But their announcements are instantly censored, so that nobody in China knows.

2011: All those who register at the aforementioned websites are systematically tracked down by the Great Wall system. Their computers are re-installed. Afterwards, if the users want to visit a general-purpose website, they can only reach People.com.cn and Xinhua; if they want to visit a forum, they can only go to Strong Nation Forum and Tiexue Forum; if they want to visit a video site, they can only go to CCTV 1. Once the system is re-installed this way, there is no way to undo the settings.

2011: The price of computers goes up by 100%. Computer scalpers proliferate. When users buy new computers, they find that they can only access the aforementioned websites.

(more...)

Tags:
Post by SUN @ 12:17 pm | 他山之石 | Comments (3)