Skip to content

Instantly share code, notes, and snippets.

@jcass8695
Last active June 13, 2020 12:55
Show Gist options
  • Save jcass8695/f589a48578a793078c203862aee10e94 to your computer and use it in GitHub Desktop.
Save jcass8695/f589a48578a793078c203862aee10e94 to your computer and use it in GitHub Desktop.
Bash/jq one liner to grab the stats on every weapon in Red Dead Redemption 2 and format in nice pretty JSON
#! env bash
curl "https://www.gtabase.com/media/com_jamegafilter/en_gb/8.json" \
| jq "[.[] | { name: .name } * ([.attr[] | { key: (.title | if type == \"array\" then .[0] else . end), value: (.value | if type == \"array\" then .[0] else . end) }] | from_entries)]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment