View Source LastfmArchive.Behaviour.LastfmClient behaviour (lastfm_archive v0.10.0)

Behaviour and data struct for retrieving data from Lastfm API.

Link to this section Summary

Callbacks

Returns the total playcount, registered, i.e. first scrobble time for a user.

Returns the playcount and the latest scrobble date of a user for a given time range.

Returns the scrobbles of a user for a given time range.

Link to this section Types

@type client() :: LastfmArchive.LastfmClient.t()
@type from() :: integer()
Link to this type

latest_scrobble_time()

View Source
@type latest_scrobble_time() :: integer()
@type limit() :: integer()
@type page() :: integer()
@type playcount() :: integer()
@type registered_time() :: integer()
@type to() :: integer()
@type user() :: binary()

Link to this section Callbacks

@callback info(user(), client()) ::
  {:ok, {playcount(), registered_time()}} | {:error, term()}

Returns the total playcount, registered, i.e. first scrobble time for a user.

Link to this callback

playcount(user, {}, client)

View Source
@callback playcount(user(), {from(), to()}, client()) ::
  {:ok, {playcount(), latest_scrobble_time()}} | {:error, term()}

Returns the playcount and the latest scrobble date of a user for a given time range.

Link to this callback

scrobbles(user, {}, client)

View Source
@callback scrobbles(user(), {page(), limit(), from(), to()}, client()) ::
  {:ok, map()} | {:error, term()}

Returns the scrobbles of a user for a given time range.

See Lastfm API documentation for more details.