diff --git a/controllers/api.js b/controllers/api.js index 5772dd6ec3..09c073efc1 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -182,9 +182,21 @@ exports.getNewYorkTimes = function(req, res) { */ exports.getLastfm = function(req, res) { var lastfm = new LastFmNode({ - api_key: '1f3e35019e98124cc8f75f8ae99df25f', // sign-up for a key at http://www.last.fm/api + api_key: '1f3e35019e98124cc8f75f8ae99df25f', secret: '4ae76d10d76cf680cebf4f0c8dea1aa4' }); + + lastfm.request("artist.getInfo", { + artist: 'Evanescence', + handlers: { + success: function(data) { + console.log(data); + }, + error: function(error) { + console.log(error.message); + } + } + }); }; /** diff --git a/views/api/lastfm.jade b/views/api/lastfm.jade new file mode 100644 index 0000000000..a95f64a3d1 --- /dev/null +++ b/views/api/lastfm.jade @@ -0,0 +1,19 @@ +extends ../layout + +block content + .page-header + h1 + i.fa.fa-music + | Last.fm API + .btn-group.btn-group-justified + a.btn.btn-lg.btn-primary(href='http://developer.github.com/guides/getting-started/', target='_blank') + i.fa.fa-check-square-o + | Getting Started + a.btn.btn-lg.btn-primary(href='https://apigee.com/console/github', target='_blank') + i.fa.fa-laptop + | API Console + a.btn.btn-lg.btn-primary(href='http://developer.github.com/v3/', target='_blank') + i.fa.fa-file-text-o + | Documentation + + p last.fm api \ No newline at end of file