
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
hapi-superfeedr
Advanced tools
This is a re-usable [Hapi](http://hapijs.com/) plugin for [Superfeedr](https://superfeedr.com/)
This is a re-usable Hapi plugin for Superfeedr. It implements a small subset of PubSubHubbub API calls to allow the following:
var superfeedr = require('hapi-superfeedr');
var superfeedrOptions = {
login: 'demo', // Superfeedr login
password: 'ee72118e8a2a7939361fe48c478b9135', // Superfeedr token
webhooks: {
host: '14ab6330636c.b.passageway.io', // web accessible host of your application
base: '/superfeedr', // base path for the webhook. make sure you use a unique base path to avoid route conflicts
scheme: 'http', // can also be 'https'
port: 80 // defaults to 80, but can be configured
}
}
server.pack.register({plugin: superfeedr, options: superfeedrOptions}, function(err) {
if (err) {
console.error('Failed to load a plugin:', err);
}
});
```javascript
Later, anywhere your app you can invoke the following:
```javascript
// Handle notifications
server.plugins.superfeedr.on('notification', function(feed_id, payload, url, request) {
// Save to database, send to user... etc
});
// Subscribe to a feed
// Takes the feed url, a unique feed id (primary key, ideally) and an set of options:
// - retrieve: yield the previous feed entries
// - format: atom or json
// - secret: a secret string used to compute an HMAC signature for secure notifications. (not implemented by this plugin, you'll have to handle it yourself)
server.plugins.superfeedr.subscribe(url, id, {retrieve: true, format: 'atom', 'secret': 'xxxx'}, function(error, body) {
// if !error => success. Body will only have data if you used retrieve to subscribe
});
// Unsubscribe from a feed
// Takes the feed url, a unique feed id (you need to use the same used for subscription)
server.plugins.superfeedr.unsubscribe(url, id, function(error) {
// if !error => success.
});
Warning: This is my very very first hapi project, so there are likely imperfections and even bugs. Please use with caution and feel free to fork and fix/improve. It also only implements a very small subset of Superfeedr features.
FAQs
This is a re-usable [Hapi](http://hapijs.com/) plugin for [Superfeedr](https://superfeedr.com/)
The npm package hapi-superfeedr receives a total of 2 weekly downloads. As such, hapi-superfeedr popularity was classified as not popular.
We found that hapi-superfeedr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.