lastfm_archive v0.3.1 LastfmArchive.Extract View Source
This module provides functions that interact with Lastfm API for data extraction and storage.
Link to this section Summary
Functions
Issues a request to Lastfm to extract scrobbled tracks for a user
Write binary data or Lastfm response to a configured directory on local filesystem for a Lastfm user
Link to this section Types
Link to this type
lastfm_response()
View Source
lastfm_response() :: {:ok, map()} | {:error, binary(), HTTPoison.Error.t()}
Link to this section Functions
Issues a request to Lastfm to extract scrobbled tracks for a user.
See Lastfm API documentation for details on the use of parameters.
Link to this function
write(user, data, filename \\ "1")
View Source
write(binary(), binary() | lastfm_response(), binary()) :: :ok | {:error, :file.posix()}
Write binary data or Lastfm response to a configured directory on local filesystem for a Lastfm user.
The data is compressed, encoded and stored in a file of given filename
within the data directory, e.g. ./lastfm_data/user/
as configured
below:
config :lastfm_archive,
...
data_dir: "./lastfm_data/"