Created
January 24, 2021 06:26
-
-
Save tylerszabo/954571ea582648d5926258bc83a80b78 to your computer and use it in GitHub Desktop.
Output Fitocracy CSV
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
// Run the following on the Performance report on your Profile page: https://www.fitocracy.com/profile/<username>/?performance | |
(function(){ | |
var z_history = $('#history_activity_chooser')[0]; | |
var z_promises = []; | |
for (var i = 0; i < z_history.options.length; i++) { | |
z_promises.push(load_chart(z_history.options[i].value, z_history.options[i].innerText)); | |
} | |
Promise.all(z_promises).then(function() { | |
var z_csv = "" | |
console.log("loaded " + Object.keys(ref_history).length + " of " + z_history.options.length); | |
for (var i = 0; i < z_history.options.length; i++) { | |
if (ref_history[z_history.options[i].value]["csv"] === undefined) { | |
z_csv += "\"Failed to load " + z_history.options[i].innerText + "\"\n" | |
} else { | |
z_csv += ref_history[z_history.options[i].value]["csv"] | |
} | |
} | |
document.writeln("<pre>" + z_csv + "</pre>"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment