{"_id":"@daangamesdg/youtube-notifications","_rev":"6-f6bb949299b2ac9047207e49a1aaca57","name":"@daangamesdg/youtube-notifications","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@daangamesdg/youtube-notifications","version":"1.0.0","description":"The TypeScript compatible version of 'youtube-notification'","main":"src/index.js","types":"typings/index.d.ts","author":{"name":"DaanGamesDG","email":"daan@daangamesdg.wtf"},"license":"MIT","private":false,"dependencies":{"axios":"^0.24.0","express":"^4.17.1","nanoid":"^3.1.30","xml2js":"^0.4.23"},"devDependencies":{"@types/express":"^4.17.13","@types/xml2js":"^0.4.9","eslint":"^8.1.0"},"scripts":{"lint":"eslint src"},"homepage":"https://github.com/DaanGamesDG/youtube-notifications#readme","repository":{"url":"https://github.com/DaanGamesDG/youtube-notifications"},"licenseText":"MIT License\n\nCopyright (c) 2021 DaanGamesDG\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@daangamesdg/youtube-notifications@1.0.0","dist":{"shasum":"5f02450fcc20ce0aef8b19f322128a5d2c1fbac4","integrity":"sha512-Vu389dzt8NTJYRzZr1G/x/3Faiu22xCkzi8av4K1Uc1x4dYpbHnA4ZxDhByTE8hA8cr3TgSCXmKlod3o4oOYSw==","tarball":"https://registry.npmjs.org/@daangamesdg/youtube-notifications/-/youtube-notifications-1.0.0.tgz","fileCount":10,"unpackedSize":19994,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZw8Jl8i5Innxyhn+ozqAjmNhSGQUBumUaKyT2X2aGLQIgL9hVb7/8uWyG6VPRa55bm6akBYYNg+wpRxwF16jH5F8="}]},"_npmUser":{"name":"daangamesdg","email":"dwklarenbeek@gmail.com"},"directories":{},"maintainers":[{"name":"daangamesdg","email":"dwklarenbeek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/youtube-notifications_1.0.0_1635691454162_0.12894609609438312"},"_hasShrinkwrap":false},"1.0.1":{"name":"@daangamesdg/youtube-notifications","version":"1.0.1","description":"The TypeScript compatible version of 'youtube-notification'","main":"src/index.js","types":"typings/index.d.ts","author":{"name":"DaanGamesDG","email":"daan@daangamesdg.wtf"},"license":"MIT","private":false,"dependencies":{"axios":"^0.24.0","express":"^4.17.1","nanoid":"^3.1.30","xml2js":"^0.4.23"},"devDependencies":{"@types/express":"^4.17.13","@types/xml2js":"^0.4.9","eslint":"^8.1.0"},"scripts":{"lint":"eslint src"},"homepage":"https://github.com/DaanGamesDG/youtube-notifications#readme","repository":{"url":"https://github.com/DaanGamesDG/youtube-notifications"},"licenseText":"MIT License\n\nCopyright (c) 2021 DaanGamesDG\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@daangamesdg/youtube-notifications@1.0.1","dist":{"shasum":"877ba92e7d29cb9c779066a2226da3760566cb31","integrity":"sha512-sU+EU1knwA8/tNWVQPEhWTAci+4V9FQCSXdG6huNW4y2Z2vwvycwJ1iAaeKVqYsdaFU8COE1SXluvT67y33zbQ==","tarball":"https://registry.npmjs.org/@daangamesdg/youtube-notifications/-/youtube-notifications-1.0.1.tgz","fileCount":10,"unpackedSize":20529,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRjudST/IsqbA64AAH2zNdyBIjsBOLWwdTKi6kYGczZAIgSFez8JwHP2tHRFr0R7/oH+mpChVTN8yOGIMSSu0o2pU="}]},"_npmUser":{"name":"daangamesdg","email":"dwklarenbeek@gmail.com"},"directories":{},"maintainers":[{"name":"daangamesdg","email":"dwklarenbeek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/youtube-notifications_1.0.1_1635692339962_0.6499260348223614"},"_hasShrinkwrap":false},"1.0.2":{"name":"@daangamesdg/youtube-notifications","version":"1.0.2","description":"The TypeScript compatible version of 'youtube-notification'","main":"src/index.js","types":"typings/index.d.ts","author":{"name":"DaanGamesDG","email":"daan@daangamesdg.wtf"},"license":"MIT","private":false,"dependencies":{"axios":"^0.24.0","express":"^4.17.1","nanoid":"^3.1.30","xml2js":"^0.4.23"},"devDependencies":{"@types/express":"^4.17.13","@types/xml2js":"^0.4.9","eslint":"^8.1.0"},"scripts":{"lint":"eslint src"},"homepage":"https://github.com/DaanGamesDG/youtube-notifications#readme","repository":{"url":"https://github.com/DaanGamesDG/youtube-notifications"},"licenseText":"MIT License\n\nCopyright (c) 2021 DaanGamesDG\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@daangamesdg/youtube-notifications@1.0.2","dist":{"shasum":"a661589a6752ee05e40a7f5691bafea4900fa266","integrity":"sha512-Pfa8Q2h2DYgUNzzaSSMlO9EuXN4cFk9B0pzS6Zw7TB9QqnGX9meu+P+70WyeCnG7uuQvqLQfNdN18DJoX7TtQA==","tarball":"https://registry.npmjs.org/@daangamesdg/youtube-notifications/-/youtube-notifications-1.0.2.tgz","fileCount":10,"unpackedSize":20675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzeptCRA9TVsSAnZWagAA3REQAJ3wfoxh4PNUsJdUcd8z\nTGEDOTQaq5QnoYVuYvKA+9gzTnHjihclB8HCGcaSvm7dinkWIsfmAZR2EnHN\nQPXAuhWVORwZWIbpZP/H9SmdC26Rn1yMKcXQyxOe02kdIrscH333T4TdaZdR\nbcGtyXlXl6uaed9Lm1rWjq5yqdeZRTRCl1F0XCut4gYhISXZeJc82yrI37S9\n0CeFQVjim52hHsgLf+YjjZxCawYQMSnp1hn72ohqiMLGBQyYwljb8ysN4AgA\nhZ4c+A4tEDCo7ZHtI7JKJCGIYjHXaQ1oeiDxudQkHe3DeuSLyhQn5kVjU0lu\nBK/BoW2I0muU1HPsozSs+GGjZD89n2T4g1viq/YTJy7/lwwPYwBb8BeMh+Ox\nPgblnKgMR+t7PXnDHJXMS29kbkEp8yjhwFxPuhk1I2hoqpHE6eQJFb0FJW7d\nGBn14ZkmNwyoR664DbaHposn7nytJQEJUVqJ9TGpKJ+8FtYcbZmmo6XPhLo4\nTjgEFYenIU4hxrPf9VCXZHbZz+6o/OnMIHaokBu60PJXzcxarOacobl+aCST\nF4Exn1Xo/gQQMsJPa8HQ6JChC2FEPlhGJ9EgEXCKxpKH/AYzvCEqKweShWQn\nPslv2uzed6zeuLUbtn4fz0jGcM2XE3EiLdDchwkbrilN3t2aAeH4SpKT2nbo\nQi/V\r\n=mNNf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyqzEtowiE69nwUY4LpIIPYPQEsrBHt17iG0GQ/ch0hgIgHx9yVC8haCVeFZruRtgE9kB8d+JPJhy1Ug3h96DtUmE="}]},"_npmUser":{"name":"daangamesdg","email":"dwklarenbeek@gmail.com"},"directories":{},"maintainers":[{"name":"daangamesdg","email":"dwklarenbeek@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/youtube-notifications_1.0.2_1635692720389_0.6275117241232753"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-31T14:44:14.099Z","1.0.0":"2021-10-31T14:44:14.280Z","modified":"2022-11-25T16:24:14.148Z","1.0.1":"2021-10-31T14:59:00.150Z","1.0.2":"2021-10-31T15:05:20.529Z"},"maintainers":[{"email":"npm@dnkl.xyz","name":"ijskoud"}],"description":"The TypeScript compatible version of 'youtube-notification'","homepage":"https://github.com/DaanGamesDG/youtube-notifications#readme","repository":{"url":"https://github.com/DaanGamesDG/youtube-notifications"},"author":{"name":"DaanGamesDG","email":"daan@daangamesdg.wtf"},"license":"MIT","readme":"<h1 align=\"center\">@daangamesdg/youtube-notifications</h1>\n\nThe TypeScript compatible version of [youtube-notification](https://www.npmjs.com/package/youtube-notification).\nFull credits go to them as I only bumped the dependencies and added TypeScript declarations to the code.\n\n## Install\n\n```sh\n# npm install @daangamesdg/youtube-notifications\nyarn add @daangamesdg/youtube-notifications\n```\n\n## Usage\n\nJavaScript example:\n\n```js\nconst Notifier = require(\"@daangamesdg/youtube-notifications\");\n\nconst notifier = new Notifier({\n\thubCallback: \"https://example.com/youtube\",\n\tport: 8080,\n\tsecret: \"Something\",\n\tpath: \"/youtube\",\n});\nnotifier.setup();\n\nnotifier.on(\"notified\", (data) => {\n\tconsole.log(\"New Video\");\n\tconsole.log(`${data.channel.name} just uploaded a new video titled: ${data.video.title}`);\n});\n\nnotifier.subscribe(\"channel_1\");\n```\n\nTypeScript example:\n\n```ts\nimport Notifier from \"@daangamesdg/youtube-notifications\";\n\nconst notifier = new Notifier({\n\thubCallback: \"https://example.com/youtube\",\n\tport: 8080,\n\tsecret: \"Something\",\n\tpath: \"/youtube\",\n});\n\nnotifier.setup();\n\nnotifier.on(\"notified\", (data) => {\n\tconsole.log(\"New Video\");\n\tconsole.log(`${data.channel.name} just uploaded a new video titled: ${data.video.title}`);\n});\n\nnotifier.subscribe(\"channel_1\");\n```\n\n## Events\n\n- **'subscribe'** - Emitted when a new subscription is added.\n- **'unsubscribe'** - Emitted when a subscription is removed.\n- **'notified'**([_data_](#types)) - Emitted when a new video is uploaded.\n\n## API\n\n### YouTubeNotifier.constructor(_options_)\n\n_options_ is an object that you may write your own properties to.\nThe following properties are read by YouTubeNotifier:\n\n- **secret** - A private key used by Pubsubhubbub, it is not required to include this property but it is highly recommended that you do. Defaults to _undefined_\n- **hubCallback** - Your ip/domain name that will be used as a callback URL by Pubsubhubbub. It _must_ be in a URL format, _ex: 'https://example.com/'_. This is a **required** property as the default is undefined.\n- **middleware** - If you are going to use the notifier with a middle ware. Defaults to _false_.\n- **path** - The path on which the server will interact with the hub. Defaults to _'/'_. Not required if you are using the notifier with a middleware.\n- **port** - The port Pubsubhubbub will listen on. This must be an open port on your system. Defaults to port _3000_. Not required if you are using the notifier with a middleware.\n- **hubUrl** - The URL in which we listen to updates from. This shouldn't be changed unless you know what you're doing.\n\n### YouTubeWatch.setup()\n\nThis function will setup a server to interact with Pubsubhubbub. If this function is called after the server has already been setup an error is thrown. If this is used with middleware set to true, an error is thrown.\n\n### YouTubeWatch.listener()\n\nThis functions will creates and return an Express middleware handler for PubSubHubbub.\n\n### YouTubeWatch.subscribe(channels=[])\n\nSubscribes to a channel or a list of channels IDs. Channels may either be a string or an array of strings. After each successful channel has been verified to receive updates a _subscribe_ event is ommited.\n\n### YouTubeWatch.unsubscribe(channels=[])\n\nRemoves the watch state from a list of channel IDs. Channels may either be a string or an array of strings. After each successful channel has been verified to stop receiving updates an _unsubscribe_ event is ommited.\n\n## Types\n\n```ts\nexport type NotifierOptions = {\n\thubCallback: string;\n\tsecret?: string;\n\tmiddleware?: boolean;\n\tport?: number;\n\tpath?: string;\n\thubUrl?: string;\n};\n\nexport interface Notification {\n\tvideo: {\n\t\tid: string;\n\t\ttitle: string;\n\t\tlink: string;\n\t};\n\tchannel: {\n\t\tid: string;\n\t\tname: string;\n\t\tlink: string;\n\t};\n\tpublished: Date;\n\tupdated: Date;\n}\n\nexport interface SubscriptionUpdate {\n\ttype: \"subscribe\" | \"unsubscribe\";\n\tchannel: string;\n}\n```\n\n## Author\n\n👤 **DaanGamesDG**\n\n- Website: https://daangamesdg.wtf/\n- Email: <daan@daangamesdg.wtf>\n- Twitter: [@DaanGamesDG](https://twitter.com/DaanGamesDG)\n- Github: [@DaanGamesDG](https://github.com/DaanGamesDG)\n\n## Donate\n\nThis will always be open source project, even if I don\"t receive donations. But there are still people out there that want to donate, so if you do here is the link [PayPal](https://paypal.me/daangamesdg) or [Ko-Fi](https://daangamesdg.wtf/kofi). Thanks in advance! I really appriciate it <3\n\n## Lisence\n\nProject is licensed under the © [**MIT License**](/LICENSE)\n\n---\n","readmeFilename":"README.md"}