V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
imom0
V2EX  ›  Project Picky

给Picky添加了PubSubHubbub支持。

  •  
  •   imom0 · 2010-10-26 12:35:06 +08:00 · 5834 次点击
    这是一个创建于 4902 天前的主题,其中的信息可能已经有所发展或是发生改变。
    给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添加 [email protected] 机器人为好友,然后向它发送消息,内容为 "/subscribe http://imimom0.appspot.com/index.xml"。发送一篇测试日志,看是否有通知。

    http://imimom0.appspot.com/add-pubsubhubbub-feed-support-for-picky
    2 条回复    1970-01-01 08:00:00 +08:00
    billychow
        1
    billychow  
       2010-10-26 15:23:18 +08:00
    可惜目前只有 GG 支持,twitter, facebook 等还是只支持 pull,不支持 push...
    claliu
        2
    claliu  
       2010-10-26 16:52:49 +08:00
    希望 @Livid 能够看到这个 post 如果可能的话 加到 @Livid 的 todo list
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3459 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:08 · PVG 08:08 · LAX 17:08 · JFK 20:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.