Last active
October 15, 2016 03:08
-
-
Save rossedman/d13225357df2ee9b838e07a17605147c to your computer and use it in GitHub Desktop.
MTG Cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Use jq to curl down magic cards into individual files to process into DocumentDB in Azure | |
# | |
# List all sets to process | |
SETS=(MPS KLD DDR CN2 V16 EMN EMA SOI W16 DDQ OGW C15 EXP BFZ DDP V15) | |
for i in "${SETS[@]}" | |
do | |
curl "https://mtgjson.com/json/$SET" | jq -c -M '.cards[]' | \ | |
while read line; do echo $line > cards/$i-$(pwgen 13 1).json; done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment