EDIT:
Latest files:
Latest json export JS script (2021-03-20): https://pastebin.com/K7QEHYAD
Latest json-to-csv conversion jq script (2021-03-20): https://pastebin.com/sw3Eh3w8
Latest changes:
- Add scorecardURL…
Hello, it is such a great what you provided - it works just fantastic and I even managed to modify "golf-export" script to add some more details to CSV ;-)
As I am not so fluent with json scripts…
Once again, thank you so much for great help. This is now fulfilling my needs perfectly. I would like to offer a beer if possible for such great and perfect support.
Sorry, bug in the script -- my bad. I edited my previous comment with a new link.
The script did run for me on Chrome/Firefox on Windows. Curious what browser/OS you're using.
Thanks for the update, I will try it on tommorrow.
I tried on both Chrome and Firefox on Windows.
Oh, it worked for me because I only tested with one (fake) scorecard haha. Anyway, it should be good to go now.
Hello, yes now it works and I got all my scorecards downloaded.
Next would be to get help from you to make it in table format, can you help on that ?
>>> As for getting this data into CSV, I can't easily help anyone with that, as the data has a complex structure (e.g. lists
>>> inside of lists), so it's not trivial to "flatten it" so it can easily be displayed as table.
Thanks in advance ;-)
I edited my previous comment with a very basic jq script to convert your scorecards to CSV, after exporting them as JSON.
You should be able to play around with the example to extract additional data.
I updated the golf export script to add a handy Download button. See link in original comment.
Hello, it is such a great what you provided - it works just fantastic and I even managed to modify "golf-export" script to add some more details to CSV ;-)
As I am not so fluent with json scripts I just would ask if you are able to extract hole pars to CSV ?
"holePars": "434545434435454434
Thanks a lot for all great you have done - I think many of us as golfers are really warmly welcoming this as now we can further analyse our golf statistics !
"holePars": "434545434435454434
I updated the original comment with a link to the updated jq script.
The new code is this:
In jq, filtering a string (holePars) with [x:y] gives you all the characters starting with index x, up to and not including index y. (The indexes start at 0.)
In the golf export data, the scorecard hole number field is the hole # (starting at 1).
So basically, the code is saying: "For hole X, give me the character from holePars at the same index"
I updated the export script and jq script to add a link to the scorecard in Garmin Connect, for convenience.
I also added some sample json and a "spec" for how the script creates it.
I probably won't be updating this anymore as obviously pastebin + garmin forums isn't an ideal way to host constantly changing code, but if anyone wants to host this on github and turn this into a real project, I've got no problem with that.