module Network.Lastfm.API.Auth
( getMobileSession, getSession, getToken
, getAuthorizeTokenLink
) where
import Network.Lastfm
getMobileSession :: Username -> APIKey -> AuthToken -> Lastfm Response
getMobileSession username apiKey token = callAPI
[ (#) (Method "auth.getMobileSession")
, (#) username
, (#) token
, (#) apiKey
]
getSession :: APIKey -> Token -> Lastfm Response
getSession apiKey token = callAPI
[ (#) (Method "auth.getSession")
, (#) apiKey
, (#) token
]
getToken :: APIKey -> Lastfm Response
getToken apiKey = callAPI
[ (#) (Method "auth.getToken")
, (#) apiKey
]
getAuthorizeTokenLink :: APIKey -> Token -> String
getAuthorizeTokenLink apiKey token = "http://www.last.fm/api/auth/?api_key=" ++ value apiKey ++ "&token=" ++ value token