Skip to content

Instantly share code, notes, and snippets.

@timtomch
Last active July 3, 2023 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timtomch/e36624719d25de1ed7a5e286ba6b6805 to your computer and use it in GitHub Desktop.
Save timtomch/e36624719d25de1ed7a5e286ba6b6805 to your computer and use it in GitHub Desktop.
Break down media objects by type for Smithsonian elements
#!/bin/zsh
setopt extendedglob
echo "\nMedia type breakdown for CC0 objects:\n"
for file in ^index.txt
do
cat $file |jq -c '. | select((.type=="edanmdm") and (.content.descriptiveNonRepeating.online_media.mediaCount>0) and (.content.descriptiveNonRepeating.online_media.media[].usage.access=="CC0")) | .content.descriptiveNonRepeating.online_media.media[].type'
done | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment