free-exercise-db icon indicating copy to clipboard operation
free-exercise-db copied to clipboard

[suggestion] Download images script

Open viciousnemesis opened this issue 2 years ago • 1 comments

Because the images are tucked away, it would be nice to have a script to download them all. It would be even nicer if you could automatically create a gif from the images as well ;)

With the help of ChatGPT, I had this made. GitHub won't allow me to upload .sh files, so it's a .txt. It had to do some renaming due to directory creation/matching issues with the following exercises:

  • 3/4 Sit-Up
  • 90 90 Hamstring
  • Adductor Groin
  • Bradford Rocket Presses
  • Gorilla Chin Crunch
  • Knee Hip Raise on parallel bars
  • Rocky Pullups pulldowns
  • Trail Running walking

image_download.txt

viciousnemesis avatar Oct 29 '23 13:10 viciousnemesis

Love the idea!, from taking a look at the script I believe the issue you've got is your using the name field in the JSON vs the id field which normalises the name into an underscored version eg. Gorilla Chin/Crunch vs Gorilla_Chin_Crunch

I didn't run the script however I did validate at least the JSON and directory matching is correct eg.

cd exercises
cd "$(jq --raw-output < Gorilla_Chin_Crunch.json '.id')"

I think this could be a potentially simple task in the Makefile just a simple glob/enumeration with the image magick convert command you've got but always open to other implementations :)

yuhonas avatar Nov 22 '23 07:11 yuhonas