youtube-list-broadcasts
v0.0.6
Published
This module gets a list of your active (live) broadcasts on YouTube. It deals with all the ugly authentication stuff.
Downloads
2
Readme
youtube-list-broadcasts
NodeJS module meant to list all of your active broadcasts and say if the specified id is actively broadcasting. YouTube API v3 compliant.
Here is what I'm doing outside the module to talk with it: var express = require('express'); var youtube = require('youtube-list-broadcasts') var mongojs = require('mongojs') var db = mongojs('mydb', ['mycollection']) var app = express(); var settings = { client_id: CLIENT_ID, client_secret: CLIENT_SECRET, redirect_url: "https://www.mywebsite.com/callback/youtube", collection: db.mycollection }
app.get('/', function(req, res){
youtube.liveBroadcasts(YOUTUBE_CODE, settings, function(err, response) {
if(err) {
res.send('Move along... ' + err)
} else {
res.send("It's alive!!");
}
})
})
app.get('/callback/youtube', function(req, res) {
youtube.getNewToken(settings, req.query.code, function(err, result) {
res.redirect('/')
})
})
app.listen(80);