Hey Fred, can you make a Perl or BASH script for this?
User story:
- Be me.
- Take photos with (phone) camera.
- They magically go up to photos.google.com
- Visit photos.google.com and checkbox the ones I want in a zip file
- Download zipfile photos.zip
- Rename zipfile to 2021_jun_21_my_cool_topic.zip
- unzip zipfile
- Photos magically end up in 2021_jun_21_my_cool_topic/
- Photos still have stupid filenames.
- Rename photos to 2021_jun_21_my_cool_topic_variant_foo.jpg
Can you create a script that helps with steps 6-10, given the following inputs?
Human inputs:
- location of photos.zip
- value of $my_cool_topic
Computer inputs:
- unique filenames inside zip.
Script pseudocode:
$TODAY = YYYY_mmm_dd format of today’s date
Look for 4 digits at beginning of $my_cool_topic
If 4 digits are NOT there, prepend $TODAY to $my_cool_topic (comment) Now $my_cool_topic has a date prepended either by human at script starttime or by script during runtime
Rename photos.zip to $my_cool_topic.zip
Unzip $my_cool_topic.zip into $my_cool_topic/
visit $my_cool_topic/
prepend each filename with $my_cool_topic
DONE