RSS pubsubhubbub 实施
根据 pubsubhubbub 我需要添加
<link rel="hub" href="http://pubsubhubbub.appspot.com"/>
到我的频道标签,但我的频道已经包含一个指向我自己网站的链接标签,添加另一个链接意味着我无法通过验证,因为同一频道中有两个链接标签。
不幸的是,我无法在 pubsubhubbub 中打开新问题
有没有办法处理同一频道中的两个链接?
谢谢!
According to pubsubhubbub I need add
<link rel="hub" href="http://pubsubhubbub.appspot.com"/>
to my channel tag, but my channel already contains a link tag to my own site, and adding another link means I can't pass verification because of there being two link tags in the same channel.
Unfortunately I couldn't open new issue in pubsubhubbub
Is there any way to deal with two link in the same channel?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然,您可以在
中添加多个标记,但链接标记需要位于 Atom 命名空间中,而不是位于 RSS 命名空间中,是的,它们都可以在同一个 feed 中使用,只要您在atom命名空间中的标签前面加上
atom
,然后使用xmlns:atom="http://www.w3.org/2005/Atom"
。例如,您可以这样:
还请记住,名称空间定义是从父元素“继承”的。因此,您只需添加
元素即可:UPDATE 上面的答案适用于 PubSubHubbub 0.3,它特定于 RSS/Atom 提要。规范的最新版本支持任何 mime 类型,这意味着必须使用 2 个
Link
标头在 HTTP 级别执行发现。Of course you can add several the
<link>
tags in your<channel>
, but the link tags need to be in the Atom namespace, not in the RSS namespace, and yes, they can both be used in the same feed, as long as you prefix tags in the atom namespace withatom
and later define what it means by usingxmlns:atom="http://www.w3.org/2005/Atom"
.For example, you can have this :
Also remember that the namespace definitions are "herited" from the parent elements. SO you can just add in the
<channel>
element and you can just write:UPDATE The answer above applies to PubSubHubbub 0.3 which was specific to both RSS/Atom feeds. The latest version of the spec brings support for any mime type, which means that discovery has to be performed at the HTTP level using 2
Link
headers.如果您没有将 feed 定义为 Atom feed,则可以执行以下操作:
必须存在 xmls:atom 属性才能使用 Atom 命名空间。我认为您不需要使用多次。通过原子命名空间,您可以使用多个链接。
If you are not defining your feed as an atom feed you can do this:
the xmls:atom attribute has to be there to use the atom namespace. I don't think you would need to use more than once though. With the atom namespace you can use more than one link.