forked from GitHub/dbot
youtube debug output
This commit is contained in:
parent
e9c6729894
commit
99eb1462ad
@ -64,6 +64,7 @@ var link = function(dbot) {
|
||||
for(var i=0;i<this.handlers.length;i++) {
|
||||
var matches = this.handlers[i].regex.exec(link);
|
||||
if(matches) {
|
||||
console.log(this.handlers[i].name);
|
||||
handler = this.handlers[i];
|
||||
break;
|
||||
}
|
||||
@ -147,6 +148,7 @@ var link = function(dbot) {
|
||||
var urlMatches = event.message.match(this.urlRegex);
|
||||
if(urlMatches !== null) {
|
||||
this.links[event.channel.name] = urlMatches[0];
|
||||
console.log('DEBUG: got a link');
|
||||
if(this.config.autoTitle == true) {
|
||||
this.api.parseLink(urlMatches[0], function(result) {
|
||||
event.reply(result);
|
||||
|
@ -53,10 +53,12 @@ var youtube = function(dbot) {
|
||||
this.onLoad = function() {
|
||||
dbot.api.link.addHandler(this.name, this.LinkRegex,
|
||||
function(match, name, callback) {
|
||||
console.log('DEBUG: well it got to the callback');
|
||||
request.get(this.ApiRoot + '/videos/' + match[2], {
|
||||
'qs': this.params,
|
||||
'json': true
|
||||
}, function(error, response, body) {
|
||||
console.log('DEBUG: well it got to the callback of the callback');
|
||||
if(_.isObject(body) && _.has(body, 'entry')) {
|
||||
var v = body.entry;
|
||||
if(!_.has(v, 'yt$rating')) {
|
||||
|
Loading…
Reference in New Issue
Block a user