diff --git a/modules/lastfm/config.json b/modules/lastfm/config.json index 222be76..817c6b1 100644 --- a/modules/lastfm/config.json +++ b/modules/lastfm/config.json @@ -1,5 +1,5 @@ { - "dependencies": [ "profile" ], + "dependencies": [ "profile", "youtube", "spotify" ], "api_key": "blah", "outputPrefix": "\u000315,5last.fm\u000f" } diff --git a/modules/lastfm/lastfm.js b/modules/lastfm/lastfm.js index 7b979c8..083c9c9 100644 --- a/modules/lastfm/lastfm.js +++ b/modules/lastfm/lastfm.js @@ -220,6 +220,7 @@ var lastfm = function(dbot) { 'artist': track.artist.name }); var term = track.name + ' ' + track.artist.name; + dbot.api.youtube.search(term, function(body) { if(_.isObject(body) && _.has(body, 'items') && body.items.length > 0) { var link = body.items[0].id.videoId @@ -227,7 +228,14 @@ var lastfm = function(dbot) { output += ' - http://youtu.be/' + link; } } - event.reply(output); + + dbot.api.spotify.spotifySearch(term, function(body, t) { + if(body) { + output += ' - ' + t; + } + + event.reply(output); + }); }); } else { event.reply('something broke');