Importing favorites from vkontakte
This commit is contained in:
@@ -25,6 +25,7 @@ class window.Vkontakte
|
||||
_session.query '/user/auth', {}, (ar) ->
|
||||
log "Authenticating user ..."
|
||||
if ar.newbie or ar.user.name == ""
|
||||
log "Requesting user name from Vkontakte ..."
|
||||
VK.Api.call 'getVariable', key: 1281, (r) ->
|
||||
_session.query '/user/update', params: { name: r.response }, (ar2) ->
|
||||
_session.setUser ar2.user
|
||||
@@ -34,6 +35,16 @@ class window.Vkontakte
|
||||
if ar.ok_reload
|
||||
window.location.reload()
|
||||
false
|
||||
log "Requesting user tracks from Vkontakte ..."
|
||||
VK.Api.call 'audio.get', uid: ar.user.vkid, (r) ->
|
||||
_session.query "/user/set_first_favorites", tracks: r.response, (r2) ->
|
||||
log "Sending your Vkontakte media collection to BeatHaven ..."
|
||||
if r2.status?
|
||||
log "Got error: #{r2.status}"
|
||||
else
|
||||
log "We believe your favorite artists are #{r2.join(', ')}"
|
||||
false
|
||||
false
|
||||
else if ar.ok_reload
|
||||
window.location.reload()
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user