scrape

package
v0.0.0-...-2aec8f2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 License: Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LASTFM_KEY string
View Source
var Lastfm = lastfm{
	Name: "Last.fm",
}
View Source
var Listenbrainz = listenbrainz{
	Name: "ListenBrainz",
}

Functions

This section is empty.

Types

type Album

type Album struct {
	URL  *string `json:"url"`
	Name string  `json:"name"`
}

type Artist

type Artist struct {
	URL  *string `json:"url"`
	Name string  `json:"name"`
}

type FromScrobbler

type FromScrobbler struct {
	Name    string `json:"name"`
	UserURL string `json:"user_url"`
}

type LastFmObject

type LastFmObject struct {
	Name string `json:"#text"`
	Id   string `json:"mbid"`
}

type LastFmResponse

type LastFmResponse struct {
	RecentTracks struct {
		Track []struct {
			Artist LastFmObject `json:"artist"`
			Album  LastFmObject `json:"album"`
			Name   string       `json:"name"`
			URL    string       `json:"url"`
			Cover  []struct {
				Size string `json:"size"`
				URL  string `json:"#text"`
			} `json:"image"`
			Time       *LastFmTime `json:"date"`
			Attributes *struct {
				NowPlaying string `json:"nowplaying"`
			} `json:"@attr,omitempty"`
		} `json:"track"`
	} `json:"recenttracks"`
}

type LastFmTime

type LastFmTime struct {
	Unix  string `json:"uts"`
	Human string `json:"#text"`
}

type Scrobbler

type Scrobbler interface {
	GetNowPlaying(username string) (resp ScrobblerResponse, err error)
}

type ScrobblerResponse

type ScrobblerResponse struct {
	FromScrobbler FromScrobbler `json:"scrobbler"`
	Cover         *string       `json:"cover"`
	Track         Track         `json:"track"`
	Artist        *Artist       `json:"artist"`
	Album         *Album        `json:"album"`
	EstTimestamp  string        `json:"est-timestamp"`
	TimestampMs   int64         `json:"timestamp"`
}

type Track

type Track struct {
	Name      string  `json:"name"`
	URL       *string `json:"url"`
	StreamURL *string `json:"stream"`
}

Jump to

Keyboard shortcuts

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