Last.fm get artist info example

This commit is contained in:
Sahat Yalkabov
2013-12-09 19:26:26 -05:00
parent 67da9d7f01
commit d4af82594f
2 changed files with 32 additions and 1 deletions

View File

@ -182,9 +182,21 @@ exports.getNewYorkTimes = function(req, res) {
*/ */
exports.getLastfm = function(req, res) { exports.getLastfm = function(req, res) {
var lastfm = new LastFmNode({ var lastfm = new LastFmNode({
api_key: '1f3e35019e98124cc8f75f8ae99df25f', // sign-up for a key at http://www.last.fm/api api_key: '1f3e35019e98124cc8f75f8ae99df25f',
secret: '4ae76d10d76cf680cebf4f0c8dea1aa4' secret: '4ae76d10d76cf680cebf4f0c8dea1aa4'
}); });
lastfm.request("artist.getInfo", {
artist: 'Evanescence',
handlers: {
success: function(data) {
console.log(data);
},
error: function(error) {
console.log(error.message);
}
}
});
}; };
/** /**

19
views/api/lastfm.jade Normal file
View File

@ -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