✨
Youtube PubSubHubBub With Firebase
Firebase cloud function to handle verification and save/update youtube feed in firestore.
Basic Setup
-
Clone the github repository :
git clone https://github.com/zainulhassan815/youtube-pubsub.git
-
cd
functions
and runnpm install
to get all packages -
Navigate back to root directory and open
.firebaserc
file. ReplaceYour-Project-ID
with your firebase project id. -
Update
YOUTUBE_API_KEY
infunctions/src/constants.ts
file. See Getting Started Guide for creating a new api key. -
Run
npm run deploy
to deploy functions to firebase. Copyyoutube-feed
endpoint to clipboard. -
Go to GoogleAppspot/Subscribe and fillin the details as follows:
- Replace
https://cloud-function/youtube-feed
with your cloud function endpoint - Replace
Channel_Id
inhttps://www.youtube.com/xml/feeds/videos.xml?channel_id=Channel_Id
with your own channel id. - Click do it.
- In your firebase console, you should see that the function
youtube-feed
is invoked with response 200.
- Replace
-
Check whether the endpoint is verified or not.
- Replace
https://cloud-function/youtube-feed
with your cloud function endpoint - Replace
Channel_Id
inhttps://www.youtube.com/xml/feeds/videos.xml?channel_id=Channel_Id
with your own channel id. - Click Get Info it.
- You should get following result with state as verified.
- Replace
License
Licensed under GNU General Public License, version 3 (GPLv3). View License