Skip to content

pubsubhubbub hub example

k00ni edited this page Feb 11, 2013 · 6 revisions

This page based on the following blog post. First, you have to start the server in a new terminal window, because it will output a lot over the time you may are interested in:

Start the engine!

cd /path/to/ow/extensions/pubsub/pubsubserver
sh start_hub_server.sh

You will some outputs and something like this:

INFO     2013-01-18 11:05:07,007 dev_appserver_multiprocess.py:655] Running application dev~pubsubhubbub on port 8080: http://localhost:8080
INFO     2013-01-18 11:05:07,007 dev_appserver_multiprocess.py:657] Admin console is available at: http://localhost:8080/_ah/admin

Now you have to start the example:

cd /path/to/ow/extensions/pubsub/pubsubserver
sh start_hub_server_example.sh

Check the light!

Please browse to http://localhost:8080/, did you see something like this?

Welcome to the PubSubHubbub reference Hub server!

PubSubHubbub is a simple, open, web-hook-based pubsub (publish/subscribe) protocol.
[...]

Yes? Great. Now please browse to http://localhost:8081/, did you see a page with a blue formular? Yes? Great, than everything works fine :)

Let's have some fun!

Creating entries

Go to http://localhost:8081/files/index.html

Create entries with username for example konrad.

Publish your feed

Go to http://localhost:8080/publish

Enter http://localhost:8081/atom/stream/konrad in the feed url field.

Click Publish

Subscribe to feed

Go to http://localhost:8080/subscribe

Entering http://localhost:8081/atom/stream/konrad for the feed url and http://localhost:8081/callback for the callback url.

Click Do it

Checking for new updates

Go to http://localhost:8081/new-notices/

You should see your previously created entries.

If you refresh http://localhost:8081/new-notices/ you will not see any new notices since it only updates new posts.

Knowing problems

The rdbms API is not available because the MySQLdb library could not be loaded.

It occurs because there is a package for establishing a db connection missing. For installing it under your Debian / Ubuntu execute this in your terminal:

sudo apt-get install python-mysqldb