Score:0

Using JQ and curl to get list of all ID's that have a certain type

cn flag

Been spending hours attempting to get this working.

So https://launchermeta.mojang.com/mc/game/version_manifest.json contains every single version of the game ever made.

I want to get a list of all IDs with a certain type, so I want to only get the ID's of releases with the type "release", I don't want any of the "snapshots".

I managed to get a list without filtering the type, but I can't work out how to filter the type.

Any help is appreciated.

Score:1
hr flag

You can filter array elements in jq using select:

curl 'https://launchermeta.mojang.com/mc/game/version_manifest.json' |
   jq '.versions[] | select(.type == "release") | .id'
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.