How to set up PuSH with Atom

From IndieWeb

How to set up PuSH with Atom is about setting up an Atom feed file for realtime publishing with PuSH 0.3 which has been superseded with How to publish and consume PubSubHubbub with PuSH 0.4 and HTML + h-feed.

Set up the HTML Page

First, you need to set up your HTML page to reference the Atom file. When subscribing from, you'll be entering someone's web page address, not an Atom feed directly.

The main tag you need to add to the <head> section is this:

<link rel="alternate" type="application/atom+xml" href="/updates.atom" />

Atom Feed

Live examples:


You will need at least these elements as the basis of the Atom feed.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="" xml:lang="en-US">
  <title>Tantek ร‡elik</title>
  <link href="" rel="alternate" title="Tantek ร‡elik" type="text/html"/>
  <link href="" rel="self"/>
  <link rel="hub" href=""/>

For the author tag, you must include a name and URI, otherwise won't recognize it as a valid feed.

By linking to the hub, you'll be taking advantage of the free hub service Google provides. Anyone will be able to subscribe to your realtime content from that hub. Anecdotal evidence has also shown that Google will actually index content posted there as well, so you can end up having real-time results in Google by using their hub.


Entry elements must have at least the following tags: title, content, published, updated, link, and id. Here are two examples you can reference.

    <link href="" rel="alternate" title=" use to CC license tweets so others may quote/embed yours independent of Twitter's TOS. #indieweb " type="text/html"/>
    <title type="xhtml">
      <div xmlns="">
use to CC license tweets so others may quote/embed yours independent of Twitter's TOS. #indieweb
    <content type="xhtml" xml:base="" xml:space="preserve">
      <div xmlns="">
use <a class="auto-link" href=""></a> to CC license tweets so others may quote/embed yours independent of Twitter's TOS. #indieweb
    <object-type xmlns=""></object-type>
    <title>Children, though they are good tax deductions, can be an expensive hobby.</title>
    <content type="xhtml" xml:base="" xml:space="preserve"><div xmlns=""> Children, though they are good tax deductions, can be an expensive hobby. </div></content>
    <link href="" rel="alternate" type="text/html" title="Children, though they are good tax deductions, can be an expensive hobby." />
    <object-type xmlns=""></object-type>

As shown in these two examples, the <title> tag can be either plain text, or can have a type="xhtml" attribute.

Statusnet/ Integration Notes

Statusnet/ (referred to as statusnet in this doc for brevity) is probably the most mature and most widely deployed OStatus implementation. If you're implementing any part of ostatus, you should aim for integration with statusnet.

statusnet won't understand a <content> element of this format:

<content type="html"><![CDATA[ <p>Example Content</p> ]]></content>

It must use xhtml, as such:

<content type="xhtml" xml:base="" xml:space="preserve">
  <div xmlns=""><p>Example Content</p></div>

The xhtml must be well-formed in order for statusnet and many feed readers to be able to successfully consume it. statusnet seems to be rather more picky compared to most feed readers, and won't give you useful error messages. If in doubt, validate!

Another thing to watch out for is elements from the activitystreams spec, e.g. activity:object-type or activity:verb. The values of these elements must be complete, well formed URLs and not just the bit on the end (e.g. 'post', 'edit', 'article', 'note' etc)!

Follow the examples above and examples in the wild that are known to be supported by statusnet instead of the examples in the activitystreams schema, which will not work with statusnet.


You can subscribe to your Atom feed using (Previously: you can subscribe to your feed in, or using a PubSubHubbub client. There is a great PuSHBot for testing which will send a message over Jabber when a feed is updated.

Checking Your Work

There are a few ways to test if this worked.

First you can use a feed validator to check for major errors such as XML errors or missing elements. does a pretty good job.

Assuming you don't get many errors there, you can try subscribing to the feed in a traditional RSS reader, such as Vienna.

Try using the PuSHBot service to send Jabber messages to you when your feed is updated. You can use this easily if you have a Jabber account, and don't forget that Google Chat accounts are Jabber.

  1. Add to your contact list.
  2. Send it a subscription message by using the /subscribe command: /subscribe
  3. If all goes well, you should see a confirmation message like Subscribed to

Then you just need to send the publish message to the appspot hub. You can do this from cURL on the command line like this:

$ curl -i -d hub.mode=publish -d hub.url=

If it worked, you will get a 204 No Content response.

See Also