🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/sigafoos/lastfm

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/sigafoos/lastfm

v0.0.0-20180426173156-d831b808b081
Source
Go
Version published
Created
Source

Go Report Card GoDoc

lastfm

Go package to interface with last.fm

Usage

Instantiate the API object with your API key and secret.

lfm := lastfm.New("yourkey", "yoursecret")
token, err := lfm.Authenticate("yourusername", "yourpassword")
if err != nil {
	lfm.SetSessionKey(token)
}

Search for an album (requiring a MusicBrainz ID) and scrobble the first result.

albums, err := lfm.AlbumSearch("slow riot for new zero kanada", true)
if err != nil {
	err = albums[0].Scrobble()
}

Obviously it makes sense to not just blindly trust that the first result is what you want. See https://github.com/Sigafoos/scrobble for a CLI utilizing this package.

FAQs

Package last updated on 26 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts