Giter Site home page Giter Site logo

wg-discogs's Introduction

Discogs API to get music metadata

Utilities to retrieve cover and artist images from Discogs.

Discogs API

Installation

npm link wg-log
npm link wg-utils
npm install

Usage

const Discogs = require('wg-discogs').Discogs;
const utils = require('wg-utils');

Create the Discogs API proxy, passing it your Discogs key and secret

var discogs = new Discogs(key, secret);

Search for releases

return discogs.searchReleases("Benighted", "Psychose", function(err, releases) {
	...

Search for artists

return discogs.searchArtists("Benighted", function(err, artists) {
	...

Get artist picture

return discogs.searchArtists("Benighted", function(err, artists) {
    var thumb = artists[0].thumb;
    var ext = utils.getExtension(thumb);
    var wstream = fs.createWriteStream('/tmp/artist.' + ext);
	 return discogs.getAlbumArt(thumb, wstream, function(err) {
	 	...
      wstream.end();

Get album covert image

return discogs.searchReleases("Benighted", "Psychose", function(err, releases) {
	var thumb = releases[0].thumb;
	var ext = utils.getExtension(thumb);
	var wstream = fs.createWriteStream('/tmp/album.' + ext);
    return discogs.getAlbumArt(thumb, wstream, function(err) {
    	...
		wstream.end();

Discogs Release

style string[] A list of syles for this release. Ex: ["Black Metal", "Death Metal"],
thumb string The URL to the thumbnail image. Ex: https://api-img.discogs.com/rYq-RDtA503SUrt-y40hUAoofFk=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-679234-1146818572.jpeg.jpg
format string[] The release format. Ex: ["CD", "Album"]
country string The release country. Ex: "France"
barcode string[] Example: ["3700132600549", "DOCdata FRANCE CDAR054"]
uri string The image orientation. 1=TopLeft, 2=TopRight, 3=BottomRight, 4=BottomLeft, 5=LeftTop, 6=RightTop, 7=RightBottom, 8=LeftBottom
community Object
label string[] The release album label. Ex: ["Adipocere Records"]
catno string
year string The release year. Ex: "2002"
genre string[] The release genre(s). Ex: ["Rock"]
title string The release title. Ex: "Benighted - Psychose"
resource_url string The release resource URL. Ex: "https://api.discogs.com/releases/679234"
type string The release type. Ex: "release"
id number The release Discogs identifier

Discogs Artist

title string[] The artist name
thumb string The URL to the thumbnail image. Ex: https://api-img.discogs.com/rYq-RDtA503SUrt-y40hUAoofFk=/fit-in/150x150/filters:strip_icc():format(jpeg):mode_rgb():quality(40)/discogs-images/R-679234-1146818572.jpeg.jpg
uri string[]
resource_url string
id number The release Discogs identifier

wg-discogs's People

Contributors

mkiki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.