pubsubhubbub 与罗马计划的链接
我想使用 Project Rome 创建 RSS 提要,使用 教程中的代码作为基础。我想添加一个 pubsubhubbub 发现链接,但似乎没有通用的方法来做到这一点。
如果我创建一个原子提要(我不想限制自己),我可以使用 Link
对象,或者我可以只添加外部标记,如下所示:
// import org.jdom.Element
Element element = new Element("link");
element.setAttribute("rel", "hub");
element.setAttribute("href", "https://myhub.example.com/endpoint");
feed.setForeignMarkup(Arrays.asList(element));
但感觉很丑。
这真的是最好的方法吗?
I want to use Project Rome to create an RSS feed, using the code from the tutorial as base. I would like to add a pubsubhubbub discovery link, but there doesn't seem to be a general way to do so.
I can use a Link
object if I create an atom feed (which I don't want to limit myself to), or I can just add foreign markup, like this:
// import org.jdom.Element
Element element = new Element("link");
element.setAttribute("rel", "hub");
element.setAttribute("href", "https://myhub.example.com/endpoint");
feed.setForeignMarkup(Arrays.asList(element));
But it feels ugly.
Is this really the best way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
罗马项目已移至 http://rometools.org。
它有一个针对 pubsubhubbub 的孵化器项目 certiorem ,看起来很有希望,因为它已经自动化:
Project rome has moved to http://rometools.org.
It has a incubator project certiorem for pubsubhubbub that looks promising as it is already mavenized:
我对罗马不太熟悉,但我想它是有效的。如果您确实使用 RSS(而不是 ATOM),请确保:
项(这不是 RSS2.0 规范的一部分)
rel = "self"
指向相应的 url。最后,您可能需要通过将“hubbub”添加到“pubsub”来编辑标题,因为 PubSub 更通用且更通用。更常用于 XMPP XEP 060 的上下文中。
I'm not very familiar with Rome, but I guess it works. If you indeed your RSS (and not ATOM), make sure you:
<link>
item (which isn't part of the RSS2.0 specrel = "self"
which points to the corresponding url.Finally, you may want to edit your title by adding "hubbub" to "pubsub", since PubSub is more general and is more often used in the context of XMPP XEP 060.