2.0.1 • Published 2 years ago

metalminer v2.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
2 years ago

Metalminer

A node module to extract music related info from various sources.

Install

yarn add metalminer

Example usage

import metalminer from 'metalminer';

// To see which properties are necessary in songInfo, see below
const songInfo = {
  title: 'Song Title',
  artist: 'Band name',
  album: 'Album name',
};

const config = {
  remotesEnabled: {
    google: true,
    lastfm: true,
    metalArchives: true,
    setlistfm: true,
    songLyrics: true,
    wikipedia: true,
    youtube: true,
  },
  lastfm: {
    apiKey: 'Enter api key for lastfm',
  },
  setlistfm: {
    apiKey: 'Enter api key for setlistfm',
  },
  youtube: {
    googleApiKey: 'Enter api key for google',
    customYoutubeSearchEngine: 'Enter id for google custom search limited to youtube',
  },
};

const lyrics = await metalminer(config).getLyrics(songInfo);

Types

interface SongInfo {
  title?: string;
  artist?: string;
  album?: string;
}

interface ResultObject<T> {
  x: T;
}

Methods

metalminer.getLyrics(songInfo: SongInfo): Promise<ResultObject>

Currently supported sites:

  • metal-archives.com
  • songlyrics.com

Arguments

  • songInfo - Required properties: title, artist and album.

Return value

-

metalminer.getBandInfo(songInfo: SongInfo): Promise<ResultObject>

Currently supported sites:

  • wikipedia.org
  • metal-archives.com

Arguments

  • songInfo - Required properties: artist and album. album can be set to any album made by the artist and is used to filter the results.

metalminer.getSimilarArtists(songInfo: SongInfo): Promise<ResultObject>

Currently supported sites:

  • metal-archives.com
  • last.fm

Arguments

  • songInfo - Required properties: artist and album

metalminer.getVideo(songInfo: SongInfo): Promise<ResultObject>

To use the video feature you need a Google API key which you set in the settings.js file.

Currently supported sites:

  • youtube.com

Arguments

  • songInfo - Required properties: artist and title

metalminer.getSetlist(songInfo: SongInfo): Promise<ResultObject>

Currently supported sites:

  • last.fm

Arguments

  • songInfo - An object containing the property artist

Return value an array of song titles from the band's latest concert.

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0

10 years ago

0.7.0

10 years ago

0.6.0

10 years ago

0.5.2

11 years ago

0.5.1

11 years ago

0.5.0

11 years ago

0.3.3

11 years ago

0.3.0

11 years ago