Last active
December 11, 2015 00:59
-
-
Save jlewin/4520381 to your computer and use it in GitHub Desktop.
Hacking on Rdio History to debug gross misreporting of play count
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
var sources = results.result.sources; | |
for(var i = 0; i < sources.length; i++) | |
{ | |
var item = sources[i]; | |
console.log(item.source.artist, '-', item.source.name); | |
console.group(); | |
var tracks = item.tracks.items; | |
for(var j = 0; j < tracks.length; j++) | |
{ | |
var t = tracks[j]; | |
console.log(t.time, t.track.name); | |
} | |
console.groupend(); | |
} | |
/////////////////////////////// | |
var sources = results.result.sources; | |
for(var i = 0; i < sources.length; i++) | |
{ | |
var item = sources[i]; | |
console.log(); | |
console.log(item.source.artist ? item.source.artist : 'Playlist', '-', item.source.name); | |
var tracks = item.tracks.items; | |
for(var j = tracks.length - 1; j >= 0; j--) | |
{ | |
var t = tracks[j]; | |
var time = t.time; | |
var d = time.substr(5, 2) + '/' + time.substr(8, 2); | |
var tx = time.substr(11); | |
console.log(' - ' + d + ' ' + tx, t.track.name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment