forked from GitHub/dbot
spotify link in listening out
This commit is contained in:
parent
238c112986
commit
7964bb9e88
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dependencies": [ "profile" ],
|
"dependencies": [ "profile", "youtube", "spotify" ],
|
||||||
"api_key": "blah",
|
"api_key": "blah",
|
||||||
"outputPrefix": "\u000315,5last.fm\u000f"
|
"outputPrefix": "\u000315,5last.fm\u000f"
|
||||||
}
|
}
|
||||||
|
@ -220,6 +220,7 @@ var lastfm = function(dbot) {
|
|||||||
'artist': track.artist.name
|
'artist': track.artist.name
|
||||||
});
|
});
|
||||||
var term = track.name + ' ' + track.artist.name;
|
var term = track.name + ' ' + track.artist.name;
|
||||||
|
|
||||||
dbot.api.youtube.search(term, function(body) {
|
dbot.api.youtube.search(term, function(body) {
|
||||||
if(_.isObject(body) && _.has(body, 'items') && body.items.length > 0) {
|
if(_.isObject(body) && _.has(body, 'items') && body.items.length > 0) {
|
||||||
var link = body.items[0].id.videoId
|
var link = body.items[0].id.videoId
|
||||||
@ -227,7 +228,14 @@ var lastfm = function(dbot) {
|
|||||||
output += ' - http://youtu.be/' + link;
|
output += ' - http://youtu.be/' + link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.reply(output);
|
|
||||||
|
dbot.api.spotify.spotifySearch(term, function(body, t) {
|
||||||
|
if(body) {
|
||||||
|
output += ' - ' + t;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.reply(output);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
event.reply('something broke');
|
event.reply('something broke');
|
||||||
|
Loading…
Reference in New Issue
Block a user