给Picky添加了PubSubHubbub支持。

2010-10-26 12:35:06 +08:00
 imom0
给Picky添加了PubSubHubbub支持。
什么是PubSubHubbub? http://code.google.com/p/pubsubhubbub/

PubSubHubbub是资讯的流通变得更实时。

需要改动Picky的地方不多。

1.改动 Atom or RSS XML file

在 /tpl/shared/index.xml 里找到

code:

<link rel="self" type="application/atom+xml" href="http://{{ site_domain }}/index.xml" />
这一行,后面添加:

code:

<link rel="hub" href="http://pubsubhubbub.appspot.com/" />
2.Ping the hub

在 /writer.py 里找到 class WriterSynchronizeHandler,Ping Google Blog Search那个注释后面有这样一行:

code:

result = urlfetch.fetch(google_ping)
在下面添加:

code:

hub_field = {"hub.mode":"publish","hub.url":"http://imimom0.appspot.com/index.xml"}
hub_ping = urlfetch.fetch(url='http://pubsubhubbub.appspot.com/',payload=urllib.urlencode(hub_field),method=urlfetch.POST)

上传后测试是否有效果,Gtalk/XMPP添加 push-bot@appspot.com 机器人为好友,然后向它发送消息,内容为 "/subscribe http://imimom0.appspot.com/index.xml"。发送一篇测试日志,看是否有通知。

http://imimom0.appspot.com/add-pubsubhubbub-feed-support-for-picky
5863 次点击
所在节点    Project Picky
2 条回复
billychow
2010-10-26 15:23:18 +08:00
可惜目前只有 GG 支持,twitter, facebook 等还是只支持 pull,不支持 push...
claliu
2010-10-26 16:52:49 +08:00
希望 @Livid 能够看到这个 post 如果可能的话 加到 @Livid 的 todo list

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/3754

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX