{"_id":"@4xx22/pubsubhubbub","_rev":"1-c7f65296b5f46902d3d16001cc37924d","name":"@4xx22/pubsubhubbub","dist-tags":{"latest":"1.0.1-fix"},"versions":{"1.0.1-fix":{"name":"@4xx22/pubsubhubbub","version":"1.0.1-fix","description":"PubSubHubbub subscriber","main":"src/pubsubhubbub.js","scripts":{"test":"grunt"},"homepage":"https://github.com/4xx22/pubsubhubbub","repository":{"type":"git","url":"git+https://github.com/4xx22/pubsubhubbub.git"},"author":{"name":"Andris Reinman"},"license":"MIT","dependencies":{"request":"2.88.0"},"devDependencies":{"chai":"4.2.0","eslint-config-nodemailer":"1.2.0","eslint-config-prettier":"3.3.0","express":"4.16.4","grunt":"1.3.0","grunt-cli":"1.3.2","grunt-eslint":"21.0.0","grunt-mocha-test":"0.13.3","mocha":"5.2.0"},"gitHead":"74d4a8affb9863b903ab9c78cdaa135fc80d7212","bugs":{"url":"https://github.com/4xx22/pubsubhubbub/issues"},"_id":"@4xx22/pubsubhubbub@1.0.1-fix","_nodeVersion":"16.6.2","_npmVersion":"8.1.0","dist":{"integrity":"sha512-SgIs3Fi4A7Bb95XjlriELElKI7S4BC8J1IWDoaUDD7+/ZGw9or9zO6q2CN/aKSwnN6gS9h4W4vLzxIsU8pwl7w==","shasum":"3299b991ae3ddaaee158cd32f2dec593fa66b91b","tarball":"https://registry.npmjs.org/@4xx22/pubsubhubbub/-/pubsubhubbub-1.0.1-fix.tgz","fileCount":10,"unpackedSize":30371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4V8UCRA9TVsSAnZWagAAilYP/3mHzoEUSNbZo+as3AjW\naeT/fq1fT23C1lK2EC0sIZbDt19cRdOomqXbmmr0pWTNyZZktxZlfiIaBtF8\nciShF1zvYsnX1wuC/gpCpetiG2FMUKfLjXUUbX6DLnIH8QZTnjKf/oUFUHDh\njAxUOajmhBS+yG9f6tEzUqQzI12CVWokb/poF2La+RsqkkDWHYQwFmDkb2YF\nU5U2PPD4pICy0fgKOM/E60LUM2agB5n/yQbP3aoQ7LPuPRJ/X54dMq3aBieg\nxHJSJboUT0Crq9Qb3UBV0nCW4xfl//Uc5tCtCwNkRS2WnwEAlo5HoNXEsoeD\nffoxXmTO68FEhnSbfgFfIE7/e22HT1NEPF/gnIGgYJJvAy+OLzXP34NXvXzx\nrwLD7PO1PtQLRvFK3vHWw02bTD9P4GDhBcIZ5Tm7IE6xaVdBn8Gm+J0hTiX7\nu5KA5HMMuxE2GFOC16IfwawEcXv0sEJoGldzxhv3nx3i5EpF7n1Nz0IrYjr4\nnQkxCLWfRmbLmAIFGaqtkhRKeGhzwYhpkq7zDnv9iJCzBdfGDlhPvbtJW7Ay\nselFoZLYY5TB/5rT2SPEBLguleBbQWONGYTSu2N3Q6UeRFffOTDBuziYOJUk\nJ5csFwLte3mmMS1j336YAQFdntlYxZ6xN3DGbuFF9Cnv3F6v/+/Kf+57fjSb\nGUPB\r\n=XtfJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMgbwXLwxqhOhJbstRT7oxt82Q614B2YVOls8Xzj1J1QIhAO5/THW6bHY+F5Zup7/w9jTpmmBtJWdjnWwQbbFNjZ0V"}]},"_npmUser":{"name":"4xx22","email":"contact+npmjs@defalt.fr"},"directories":{},"maintainers":[{"name":"4xx22","email":"contact+npmjs@defalt.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pubsubhubbub_1.0.1-fix_1642159892617_0.9221014399228773"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-14T11:31:32.574Z","1.0.1-fix":"2022-01-14T11:31:32.795Z","modified":"2022-04-04T10:47:50.895Z"},"maintainers":[{"name":"4xx22","email":"contact+npmjs@defalt.fr"}],"description":"PubSubHubbub subscriber","homepage":"https://github.com/4xx22/pubsubhubbub","repository":{"type":"git","url":"git+https://github.com/4xx22/pubsubhubbub.git"},"author":{"name":"Andris Reinman"},"bugs":{"url":"https://github.com/4xx22/pubsubhubbub/issues"},"license":"MIT","readme":"# PubSubHubbub subscriber\r\n\r\nPubSubHubbub subscriber module. Supports both 0.3 and 0.4 hubs.\r\n\r\n**NB** Do not upgrade from v0.1.x - the API is totally different\r\n\r\n## Install\r\n\r\nInstall with npm\r\n\r\n    npm install pubsubhubbub\r\n\r\n## Usage\r\n\r\nCreate a **pubsubhubbub** server object\r\n\r\n```javascript\r\nvar pubSubHubbub = require('pubsubhubbub');\r\nvar pubSubSubscriber = pubSubHubbub.createServer(options);\r\n```\r\n\r\nWhere options includes the following properties\r\n\r\n-   **callbackUrl** Callback URL for the hub\r\n-   **headers** (optional) Custom headers to use for all HTTP requests\r\n-   **secret** (optional) Secret value for HMAC signatures\r\n-   **leaseSeconds** (optional) Number of seconds for which the subscriber would like to have the subscription active\r\n-   **maxContentSize** (optional) Maximum allowed size of the POST messages\r\n-   **username** (optional) Username for HTTP Authentication\r\n-   **password** (optional) Password for HTTP Authentication\r\n-   **sendImmediately** (optional) Send Username & Password Immediately. Defaults to false.\r\n\r\n### HTTP server mode\r\n\r\nStart a HTTP server to listen incoming PubSubHubbub requests\r\n\r\n```javascript\r\n// listen on port 1337\r\npubSubSubscriber.listen(1337);\r\n```\r\n\r\n### Express middleware mode\r\n\r\nIf you dot want to spin up a dedicated HTTP server, you can use the PubSubHubbub\r\nsubscriber as an Express middleware.\r\n\r\nAttach PubSubHubbub object to an Express server using `listener` method.\r\n\r\n```\r\n// use the same path as defined in callbackUrl\r\napp.use(\"/pubsubhubbub\", pubSubSubscriber.listener());\r\n```\r\n\r\n## Events\r\n\r\n-   **'listen'** - HTTP server has been set up and is listening for incoming connections\r\n-   **'error'** (_err_) - An error has occurred\r\n-   **'subscribe'** (_data_) - Subscription for a feed has been updated\r\n-   **'unsubscribe'** (_data_) - Subscription for a feed has been cancelled\r\n-   **'denied'** (_data_) - Subscription has been denied\r\n-   **'feed'** (_data_) - Incoming notification\r\n\r\n## API\r\n\r\n### Listen\r\n\r\nStart listening on selected port\r\n\r\n    pubSubSubscriber.listen(port)\r\n\r\nWhere\r\n\r\n-   **port** is the HTTP port to listen\r\n\r\n### Subscribe\r\n\r\nSubscribe to a feed with\r\n\r\n    pubSubSubscriber.subscribe(topic, hub, callback)\r\n\r\nWhere\r\n\r\n-   **topic** is the URL of the RSS/ATOM feed to subscribe to\r\n-   **hub** is the hub for the feed\r\n-   **callback** (optional) is the callback function with an error object if the subscription failed\r\n\r\nExample:\r\n\r\n    var pubSubSubscriber = pubSubHubbub.createServer(options);\r\n    var topic = \"http://testetstetss.blogspot.com/feeds/posts/default\";\r\n    var hub = \"http://pubsubhubbub.appspot.com/\";\r\n\r\n    pubSubSubscriber.on(\"subscribe\", function(data){\r\n        console.log(data.topic + \" subscribed\");\r\n    });\r\n\r\n    pubSubSubscriber.listen(port);\r\n\r\n    pubsub.on(\"listen\", function(){\r\n        pubSubSubscriber.subscribe(topic, hub, function(err){\r\n            if(err){\r\n                console.log(\"Failed subscribing\");\r\n            }\r\n        });\r\n    });\r\n\r\n### Unsubscribe\r\n\r\nUnsubscribe from a feed with\r\n\r\n    pubSubSubscriber.unsubscribe(topic, hub, callback)\r\n\r\nWhere\r\n\r\n-   **topic** is the URL of the RSS/ATOM feed to unsubscribe from\r\n-   **hub** is the hub for the feed\r\n-   **callback** (optional) is the callback function with an error object if the unsubscribing failed\r\n\r\nExample:\r\n\r\n    var pubSubSubscriber = pubSubHubbub.createServer(options),\r\n        topic = \"http://testetstetss.blogspot.com/feeds/posts/default\",\r\n        hub = \"http://pubsubhubbub.appspot.com/\";\r\n\r\n    pubSubSubscriber.on(\"unsubscribe\", function(data){\r\n        console.log(data.topic + \" unsubscribed\");\r\n    });\r\n\r\n    pubSubSubscriber.listen(port);\r\n\r\n    pubSubSubscriber.on(\"listen\", function(){\r\n        pubSubSubscriber.unsubscribe(topic, hub, function(err){\r\n            if(err){\r\n                console.log(\"Failed unsubscribing\");\r\n            }\r\n        });\r\n    });\r\n\r\n## Notifications\r\n\r\nUpdate notifications can be checked with the `'feed'` event. The data object is with the following structure:\r\n\r\n-   **topic** - Topic URL\r\n-   **hub** - Hub URL, might be undefined\r\n-   **callback** - Callback URL that was used by the Hub\r\n-   **feed** - Feed XML as a Buffer object\r\n-   **headers** - Request headers object\r\n\r\n## License\r\n\r\n**MIT**\r\n","readmeFilename":"README.md"}