lastfmclient

package
v0.0.0-...-b381f6d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2012 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENDPOINT                  = "http://ws.audioscrobbler.com/2.0/"
	APIKEY                    = "APIKEY"
	SECRET                    = "SECRET"
	METHOD_GET_MOBILE_SESSION = "auth.getMobileSession"
	METHOD_SCROBBLE_TRACK     = "track.scrobble"
	METHOD_UPDATE_NOW_PLAYING = "track.updateNowPlaying"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Username   string
	Password   string
	SessionKey string
	AuthToken  string
}

func NewClient

func NewClient(username, password string) *Client

func (*Client) ScrobbleTrack

func (c *Client) ScrobbleTrack(song mpdclient.Song, timestamp int64) (scrobbles []Scrobble, err error)

func (*Client) UpdateNowPlaying

func (c *Client) UpdateNowPlaying(song mpdclient.Song) (scrobble Scrobble, err error)

type MobileSession

type MobileSession struct {
	XMLName xml.Name `xml:"lfm"`
	Error   string   `xml:"error"`
	Key     string   `xml:"session>key"`
}

type NowPlaying

type NowPlaying struct {
	XMLName    xml.Name `xml:"lfm"`
	Error      string   `xml:"error"`
	NowPlaying Scrobble `xml:"nowplaying"`
}

type Scrobble

type Scrobble struct {
	Track          string `xml:"track"`
	Artist         string `xml:"artist"`
	Album          string `xml:"album"`
	IgnoredMessage string `xml:"ignoredMessage"`
}

type Scrobbles

type Scrobbles struct {
	XMLName   xml.Name   `xml:"lfm"`
	Error     string     `xml:"error"`
	Scrobbles []Scrobble `xml:"scrobbles>scrobble"`
}

Jump to

Keyboard shortcuts

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