Search code examples
rubyrsswebsub

RSS pubsubhubbub implementation


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!


Solution

  • 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 with atom and later define what it means by using xmlns:atom="http://www.w3.org/2005/Atom".

    For example, you can have this :

    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="hub" href="http://superfeedr.com"/>
    

    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:

    <atom:link rel="hub" href="http://superfeedr.com"/>
    

    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.