I was playing around with PubSubHubub and I noticed that the getting started tutorial at http://code.google.com/p/pubsubhubbub/wiki/DeveloperGettingStartedGuide is not working exactly as it should be.
I played around with the instructions and changed a few steps… and it worked.
Here’s what you should do to run PubSubHubBub example on Ubuntu 1004 ( Desktop version ) and Python 2.6
Step 1: Create a directory to hold all related files for this example
In my case, I’ve cd to Desktop and mkdir pshb. Once done, cd into pshb/
Step 2: Installing and getting the required files
You will need to install:
Unzip Google APp Engine Python client by running unzip google_appengine_1.4.1.zip
Step 3: Start PubSubHubBub
Start PubSubHubBub by running python google_appengine/dev_appserver.py pubsubhubbub/hub
Now go to http://localhost:8080
Step 4: Running the example
FIrst, cd to tubes/ihasfriendz
Next run this command : python main.py
Now navigate to http://localhost:8081/files/index.html
Step 5: Creating entries at http://localhost:8081/files/index.html
Now you can start to create entries using any username, title and content
In my case, i’ll use “eugene” as the username
* the username is required as it is part of the publish/subscribe url which we will be seeing later
Step 6: Publish your feed
Navigate to http://localhost:8080/publish
Assuming you have created entries using the username “eugene” , enter http://localhost:8081/atom/stream/eugene in the feed url field.
Click “Publish”. If nothing happens, everything is moving smoothly.
Step 7: Subscribe to feed.
Now that you have published your feed, you can subscribe it by first navigating to http://localhost:8080/subscribe and than entering http://localhost:8081/atom/stream/eugene for the feed url and http://localhost:8081/callback for the callback url.
Do not enter anything for “verify token” and HMAC secret. Entering any values for these two fields somehow screws up the example; GAE will not do any pushing or pulling of events.
Step 8: Checking for new updates
If you refresh http://localhost:8081/new-notices/ again, you will not see any new notices since it only updates new posts.
Differences as compared to the original tutorial
- No need to visit the GAE admin
- We are using Python 2.6 instead of 2.5
- We are using GAE python client 1.4.1 instead of 1.3.5
- The order of the steps are slightly changed.
Hopefully the above tutorial helps!