Skip to content

Instantly share code, notes, and snippets.

@tmacam
Created December 31, 2024 00:57
Show Gist options
  • Save tmacam/754cbcf90633b7792ba24b5d77b99022 to your computer and use it in GitHub Desktop.
Save tmacam/754cbcf90633b7792ba24b5d77b99022 to your computer and use it in GitHub Desktop.
Bookmarklet to download 604 results as CSV
javascript:(function() {
const categories = Object.fromEntries(Array.from(document.querySelectorAll("#idSkillCategoryId > option")).map(option => [option.value, option.text]));
const separator = "\t"; /* Yeah, tab separated CSV. Deal with it.*/
const tsvHeader = ["skillname", "category", "lastresult", "pr", "tries", "daysince"].join(separator);
const tsvData = personResults.resultSet.map(res => [res.skillname, categories[res.categoryid],res.lastresult, res.pr, res.tries, res.daysince].join(separator));
const tsvContent = [tsvHeader].concat(tsvData).join("\n");
const blob = new Blob([tsvContent], { type: 'text/csv' });
/* Initiate download of CSV data */
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = '604PersonalResult.csv';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
})();
@tmacam
Copy link
Author

tmacam commented Dec 31, 2024

Host to export things from Zendesk:

  1. In your browser, create a bookmark with the title "Zendesk Workout Exporter" and as address/link copy and paste the code above. Yes, all the 19 lines of the content above will be your link. That thing now became what we call a "boomarklet".
  2. Log in to 604 Athletics athlete page (zendesk)
  3. Head to https://604athletics.sites.zenplanner.com/workout-pr-page.cfm# (Workouts > Progress & results ). Beware: That pages takes an eternity to load. Yeah...
  4. Once that pages finishes loading, click on the bookmarklet you created.
  5. Voilà! A download with your workout history as a CSV should start!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment