Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spotify-data

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotify-data - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

example2.js

3

example.js

@@ -24,1 +24,4 @@ var spotify = require('./');

spotify.lookup('spotify:user:minigod:playlist:5ACX9Pa6kRUWWv9ZWD5oH4', console.log);
spotify.flatten('spotify:album:0AKaAXiqrwaXPSn9VNxK6N', console.log);
spotify.playlist.flatten('minigod', '5ACX9Pa6kRUWWv9ZWD5oH4', console.log);

@@ -36,3 +36,3 @@ var url = require('url');

Spotify.lookup = function(uri, extras, cb) {
var parsed = Spotify.uri.parse(uri);
var parsed = typeof uri === 'string' ? Spotify.uri.parse(uri) : uri;

@@ -148,3 +148,3 @@ // Playlist

href: Spotify.uri.formatURI({type:'track',id: el.attr('data-track')}),
duration: el.attr('data-duration-ms'),
duration: parseInt(el.attr('data-duration-ms')),
cover: el.attr('data-ca'),

@@ -167,6 +167,29 @@ artists: []

cb(null, tracks);
var playlist = {
playlist: {
'playlist-id': Spotify.uri.formatURI({type:'playlist', }),
title: $('div.title-content').text(),
tracks: tracks,
},
info: {
type: 'playlist'
}
}
cb(null, playlist);
});
}
Spotify.playlist.cover = function(user, id, cb) {
// spotify-uri supports parsing of playlist, but not formating -.-
var uri = ['spotify', 'user', user, 'playlist', id].join(':');
Spotify.cover(uri, cb);
}
Spotify.playlist.flatten = function(user, id, cb) {
// spotify-uri supports parsing of playlist, but not formating -.-
var uri = ['spotify', 'user', user, 'playlist', id].join(':');
Spotify.flatten(uri, cb);
}
/**

@@ -189,2 +212,4 @@ * Flattens an URI to tracks. Ie. an album returns all tracks in the album. an artist returns all tracks by the artist.

cb(null, res.album.tracks);
} else if (res.info.type === 'playlist') {
cb(null, res.playlist.tracks);
} else if (res.info.type === 'artist') {

@@ -191,0 +216,0 @@ var albums = [];

2

package.json
{
"name": "spotify-data",
"version": "0.0.1",
"version": "0.0.2",
"description": "Simple spotify metadata. Supports playlist, cover art, artist, album and track.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc