scrobble-0.2.1.1: Scrobbling server.

Safe HaskellNone
LanguageHaskell98

Scrobble.Client

Description

A client for scrobbling, based upon the Audioscrobbler Realtime Submission protocol v1.2 http://www.audioscrobbler.net/development/protocol/

Example:

import Scrobble.Client
import Data.Time

example = do
  client <- newClient Details
    { detPassword = "YOURPASS"
    , detUsername = "YOURUSER"
    , detClient   = "qlb"
    , detVersion  = "0.9.2"
    , detServer   = defaultServer
    }
  nowPlaying client NowPlaying
    { npArtist      = "Kasabian"
    , npTrack       = "Ladies and Gentlemen"
    , npAlbum       = Just "West Ryder Pauper Lunatic Asylum"
    , npLength      = Just 288
    , npPosition    = Nothing
    , npMusicBrainz = Nothing
    }
  timestamp <- getCurrentTime
  submitTracks client
               [Submission { subArtist      = "Kasabian"
                           , subTrack       = "Ladies and Gentlemen"
                           , subTimestamp   = timestamp
                           , subSource      = UserChosen
                           , subRating      = Nothing
                           , subLength      = Just 288
                           , subAlbum       = Just "West Ryder Pauper Lunatic Asylum"
                           , subPosition    = Nothing
                           , subMusicBrainz = Nothing
                           }]

Synopsis

Documentation

newClient :: Details -> IO Client Source

Create a client session. Throws ScrobblerError.

nowPlaying :: Client -> NowPlaying -> IO () Source

Send a now playing message. Throws ScrobblerError.

submitTracks :: Client -> [Submission] -> IO () Source

Submit track(s). Throws ScrobblerError.

defaultServer :: URI Source

Default Audioscrobbler server: http://post.audioscrobbler.com/