Skip to content

Instantly share code, notes, and snippets.

@viankakrisna
Created November 23, 2016 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save viankakrisna/2b0cdd8f595ebe931d97b298b988d752 to your computer and use it in GitHub Desktop.
Save viankakrisna/2b0cdd8f595ebe931d97b298b988d752 to your computer and use it in GitHub Desktop.
module.exports = function LastFMFactory ($http, CONFIG) {
'ngInject'
return {
geo: {
getTopArtists: function () {
return $http.get(CONFIG.lastfm_url + '?format=json&method=geo.getTopArtists&country=indonesia&api_key=' + CONFIG.lastfm_key)
},
getTopTracks: function () {
}
},
artist: {
getInfo: function (artist) {
return $http.get(CONFIG.lastfm_url + '?format=json&method=artist.getInfo&autocorrect=1&artist=' + artist + '&api_key=' + CONFIG.lastfm_key)
},
getTopTracks: function (artist) {
return $http.get(CONFIG.lastfm_url + '?format=json&method=artist.getTopTracks&autocorrect=1&artist=' + artist + '&api_key=' + CONFIG.lastfm_key)
},
getTopAlbums: function (artist) {
return $http.get(CONFIG.lastfm_url + '?format=json&method=artist.getTopAlbums&autocorrect=1&limit=10&artist=' + artist + '&api_key=' + CONFIG.lastfm_key)
},
addTags: function () {
},
getCorrection: function () {
},
getSimilar: function () {
},
getTags: function () {
},
getTopTags: function () {
},
removeTag: function () {
},
search: function () {
}
},
album: {
getInfo: function (artist, album) {
return $http.get(CONFIG.lastfm_url + '?format=json&method=album.getInfo&autocorrect=1&artist=' + artist + '&album=' + album + '&api_key=' + CONFIG.lastfm_key)
},
addTags: function () {
},
getTags: function () {
},
getTopTags: function () {
},
removeTag: function () {
},
search: function () {
}
},
tag: {
getInfo: function () {
},
getSimilar: function () {
},
getTopAlbums: function () {
},
getTopArtists: function () {
},
getTopTags: function () {
return $http.get(CONFIG.lastfm_url + '?format=json&method=tag.getTopTags&country=indonesia&api_key=' + CONFIG.lastfm_key)
},
getTopTracks: function (tag) {
return $http.get(CONFIG.lastfm_url + '?format=json&method=tag.getTopTracks&tag=' + tag + '&api_key=' + CONFIG.lastfm_key)
},
getWeeklyChartList: function () {
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment