Documentation ¶
Index ¶
Constants ¶
View Source
const ApiUrl = "http://ws.audioscrobbler.com/2.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func NewAuthenticatedApi ¶
func NewAuthenticatedApi(config *config.Config, ds *data_store.DataStore, lastfmUser *data_store.LastfmUser) *Api
func (*Api) GetLovedTracks ¶
func (a *Api) GetLovedTracks(limit, page int) (*GetLovedTracksResponse, *util.RequestError)
func (*Api) GetSession ¶
func (a *Api) GetSession(token string) (*GetSessionResponse, *util.RequestError)
func (*Api) GetTopTracks ¶
func (a *Api) GetTopTracks(period string, limit, page int) (*GetTopTracksResponse, *util.RequestError)
type GetLovedTracksResponse ¶
type GetLovedTracksResponse struct { XMLName xml.Name `xml:"lfm"` Status string `xml:"status,attr"` LovedTracks struct { Username string `xml:"user,attr"` Page int `xml:"page,attr"` Limit int `xml:"perPage,attr"` TotalPages int `xml:"totalPages,attr"` Total int `xml:"total,attr"` Tracks []struct { Name string `xml:"name"` Url string `xml:"url"` Date struct { Uts string `xml:"uts,attr"` } `xml:"date"` Artist struct { Name string `xml:"name"` Url string `xml:"url"` } `xml:"artist"` Images []struct { Size string `xml:"size,attr"` Url string `xml:",chardata"` } `xml:"image"` } `xml:"track"` } `xml:"lovedtracks"` }
type GetSessionResponse ¶
type GetTopTracksResponse ¶
type GetTopTracksResponse struct { XMLName xml.Name `xml:"lfm"` Status string `xml:"status,attr"` TopTracks struct { Username string `xml:"user,attr"` Page int `xml:"page,attr"` Limit int `xml:"perPage,attr"` TotalPages int `xml:"totalPages,attr"` Total int `xml:"total,attr"` Tracks []struct { Rank string `xml:"rank,attr"` Name string `xml:"name"` Duration int `xml:"duration"` PlayCount int `xml:"playcount"` Url string `xml:"url"` Artist struct { Name string `xml:"name"` Url string `xml:"url"` } `xml:"artist"` Images []struct { Size string `xml:"size,attr"` Url string `xml:",chardata"` } `xml:"image"` } `xml:"track"` } `xml:"toptracks"` }
Click to show internal directories.
Click to hide internal directories.