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