Socket
Socket
Sign inDemoInstall

github.com/sigafoos/lastfm

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/sigafoos/lastfm

Package lastfm provides a way to communicate with last.fm's api in go.


Version published

Readme

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

Last updated on 26 Apr 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc