This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$basedir = '/Volumes/VERBATIM HD/Musique/'; | |
$oauth_token = 'MY_DEEZER_OAUTH_TOKEN'; | |
$artist_iterator = new DirectoryIterator($basedir); | |
function addToAccount($artist, $album) { | |
global $oauth_token; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pause = function (ms) { | |
return new Promise(function (resolve, reject) { | |
setTimeout(function () { | |
return resolve(true); | |
}, ms); | |
}); | |
}; | |
let fetchArtists = async function (lastFmApiKey) { | |
let res = await fetch('https://ws.audioscrobbler.com/2.0/?method=library.getartists&api_key=' + lastFmApiKey + '&user=guillaumel&limit=500&format=json'); |