forked from GitHub/dbot
i think this do it
This commit is contained in:
parent
9b036039c5
commit
e9605b60d3
@ -29,8 +29,7 @@ var youtube = function(dbot) {
|
|||||||
v['yt$statistics'] = { 'viewCount': 0 };
|
v['yt$statistics'] = { 'viewCount': 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
var link = v.link[0].href.match(this.LinkRegex)[2];
|
var res = dbot.t('yt_video', {
|
||||||
return dbot.t('yt_video', {
|
|
||||||
'title': v.title['$t'],
|
'title': v.title['$t'],
|
||||||
'plays': v['yt$statistics'].viewCount.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"),
|
'plays': v['yt$statistics'].viewCount.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"),
|
||||||
'author': v.author[0].name['$t'],
|
'author': v.author[0].name['$t'],
|
||||||
@ -38,7 +37,14 @@ var youtube = function(dbot) {
|
|||||||
'dislikes': v['yt$rating'].numDislikes,
|
'dislikes': v['yt$rating'].numDislikes,
|
||||||
'minutes': minutes,
|
'minutes': minutes,
|
||||||
'seconds': seconds
|
'seconds': seconds
|
||||||
}) + ' - ' + 'http://youtu.be/' + link;
|
});
|
||||||
|
|
||||||
|
var link = v.link[0].href.match(this.LinkRegex)
|
||||||
|
if(!_.isUndefined(link)) {
|
||||||
|
res += ' - ' + link[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user