# subhub

> simple pubsubhubbub client

Latest version **0.0.5** (published 2013-01-11) · 0 weekly downloads

## Install

```sh
npm install subhub
pnpm add subhub
yarn add subhub
bun add subhub
```

Provides the command `subhub`.

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2013-01-11 |
| First published | 2013-01-11 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+5 in 3 direct dependencies) |
| Install scripts | no |
| Author | catshirt |
| Maintainers | catshirt |
| Keywords | pubsub, pubsubhubbub |

## Links

- npm: https://www.npmjs.com/package/subhub
- npm.io page: https://npm.io/package/subhub

## Dependencies (7)

- [nconf](https://npm.io/package/nconf.md) 0.6.7
- [colors](https://npm.io/package/colors.md) 0.6.0-1
- [request](https://npm.io/package/request.md) 2.12.0
- [optimist](https://npm.io/package/optimist.md) 0.3.5
- [xml2json](https://npm.io/package/xml2json.md) 0.3.2
- [feedparser](https://npm.io/package/feedparser.md) 0.10.8
- [underscore](https://npm.io/package/underscore.md) 1.4.2

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.5 (latest) — 2013-01-11

## README

# subhub

subhub is a simple node.js interface for subscribing to a pubsubhubbub hub. subhub includes a library for integrating into your existing node.js servers, as well as a simple command line tool for debugging hub output.

## using the api

subhub provides a simple library for integrating a subhub connection into your existing node.js, connect, or express http servers.

### installation

```
$ npm install subhub
```

### usage

to use the api, you simply need to configure a subhub instance, tell your server to use it's request handler, and create a subscription. a simple example of this follows.

```
http = require('http')
subhub = require('subhub')
server = do http.createServer

# configure a subhub instance
firehose = new subhub
  'url': ''
  'subscription':
    'hub.mode': 'subscribe'
    'hub.verify': 'sync'
    'hub.callback': ''
    'hub.topic': ''

# set up the http handlers
server.on 'request', firehose.requestListener
server.listen 8000

# 'data' fires for each document sent by the hub
firehose.on 'data', (doc) ->
  console.log doc

# send a subscription request
# (once subscribed, the hub will begin sending data)
do firehose.subscribe
```

## using the client

a command line client is provided which simply creates up a subscription and writes all incoming hub entries to stdout. this is the quickest way to see all the data being sent by the hub. the client uses [nconf](https://github.com/flatiron/nconf), allowing you to configure the subscription through command line arguments, environment variables, or flat files (with that order.

### installation

```
$ npm install -g subhub
```

### usage

```
$ subhub --help
Usage: subhub 

Arguments:
  -h, --help                    Help. You're looking at it
  -c, --config                  Config file                                      [./config.json]
  --http.port                   Port to run the http server on                   [80]
  --hub.url                     The url of the hub you are subscribing to
  --hub.subscription.mode       Request mode                                     [subscribe]
  --hub.subscription.verify     Hub verification mode                            [sync]
  --hub.subscription.callback   Your callback URL the hub will send data to
  --hub.subscription.topic      The feed url of the topic you are subscribing to

$ subhub --hub.url=http://yourhub --hub.subscription.topic=http://yourhub/topic --hub.subscription.callback=http://yourhost/callback
[stream of messages]
```

---
_Source: https://npm.io/package/subhub · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
