Skip to content

A simple Last.FM library written in golang

License

Notifications You must be signed in to change notification settings

lxi1400/go-lastfm

 
 

Repository files navigation

Go-LastFM

This package was forked and updated to support (most) of the current Last.FM routes. Feel free to open a pull requests for any improvments. This package should be rewritten soon, if I feel like it.

How To Install

go get github.com/lxi1400/go-lastfm

Example

Print Current/Last Track Name

package main

import (
	"fmt"
	"github.com/lxi1400/go-lastfm"
)

func main() {
	// Get Tracks
	tracks, err := lfm.GetRecentTracks("username", 1) 
	if err != nil {
		fmt.Println(err.Error())
	}

	// Get current track
	trackSlice := tracks.Tracks
	currentTrack := trackSlice[0]

	// Print the current tracks name and if it is currently playing
	fmt.Println(currentTrack["nam"])
	fmt.Println(tracks.NowPlaying)
}

var (
	lfm = lastfm.New("API_KEY")
)

About

A simple Last.FM library written in golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%