lastfm

package
v0.0.0-...-a8d8f77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ApiUrl = "http://ws.audioscrobbler.com/2.0"

https://www.last.fm/api/intro

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

func NewApi

func NewApi(config *config.Config, ds *data_store.DataStore) *Api

func NewAuthenticatedApi

func NewAuthenticatedApi(config *config.Config, ds *data_store.DataStore, lastfmUser *data_store.LastfmUser) *Api

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 GetSessionResponse struct {
	XMLName xml.Name `xml:"lfm"`
	Status  string   `xml:"status,attr"`
	Session struct {
		Name       string `xml:"name"`
		Key        string `xml:"key"`
		Subscriber string `xml:"subscriber"`
	} `xml:"session"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL