Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple set of functions to handle PubSubHubbub handshakes & verification

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .npmignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

Node PuSH helper

A simple set of functions to handle PubSubHubbub handshakes & verification.

Details

Many services including RSS aggregators like Google Reader, social networks like Facebook, and photo services like Flickr & Instagram implement some variation of the PubSubHubbub protocol (PuSH).

There are two generic bits of functionality that are required when subscribing for PuSH updates from these services. First, we need to complete a handshake with the server when subscribing.

The second bit is verifying the notification when the server pushes an update. Both of these are standard, service independent bits of code, so it didn't make sense to use code that's in a particular library. This library does nothing but those two functions and exposes simple methods that can be used in an express.js app or anywhere else.

Examples

Here's my subscription code from my app.

// a GET request will be a challenge query
app.get('/instagram/realtime', function(req, res){
  PuSHHelper.handshake(req, res);
});

// this is where Instagram will send updates (using POST)
app.post('/instagram/realtime', PuSHHelper.verifier(config.instagram.client_secret), function(req, res){
  console.log("Received a notification");

  // process the notifications

});

You can see a working example in the Proxigram source code.

Credits

The library draws functionality from the instagram-node-lib NPM located at https://github.com/mckelvey/instagram-node-lib and the nubnub project located here: https://github.com/technoweenie/nubnub


License

See the LICENSE file for information

Something went wrong with that request. Please try again.