I wasn't aware until now, that jq is actually a full blown functional programming language. Originally it was inspired by Haskell and the very first version(s) of jq were actually implemented in Haskell. Only later jq got ported over to C. To have an idea how powerfull the jq language is, there is also a jq implementation purely written in jq: https://github.com/wader/jqjq#jq#json
I have advanced the problem along a bit. My current problem is that in all my various directories of screenshot files, I have a metadata.json file I want to extract data from. I want to use the extracted data to build an appropriate "wp media import" command, to feed to WP-CLI.
Here's my dilemma: I don't know jq well enough yet. I've been trying to teach myself about how its filters work tonight, but I'm not quite comfortable enough with it or with bash to work out how to accomplish what I want to do.
Wow my perception of jq as like a grep for json has been changed it is so much more like an awk for json. very cool Thank you @FLOX_advocate and #seagl2023#jq#todayilearned
Ok folks, I decided to work openly on my Community Theatre talk at #SAPTechEd and start writing my notes in the shape of a long-form article. All critiques welcome. Share & enjoy! (And caution: WIP!)
Okay, wrestling with jq and I don't know enough about programming to google this effectively.
I have a bunch of different thingies, and some of them have the key 'heldBy: "Person"'. If I ask it to print "Held by (.heldBy)", the thingies that don't have the key just say "Held by null", and that looks gross. How do I tell jq to only print "Held by (.heldBy)" for each thingy if the key exists, and not print anything if it doesn't?
Proposition de Captcha : demander au visiteur d'écrire un programme en #jq pour un cahier des charges donné (genre, trouver tous les éléments d'un tableau qui contiennent un autre tableau qui contient une certaine chaine de caractères).
Ça élimine tous les robots et tous les humains. Seuls les mutants seront acceptés.
This has been a long dream of mine, since I added JSON support in #fs2-data. And it has never been so close to become true: the PR adding support for #JSON queries (think #jq) is ready! It allows for declarative streaming extraction and transformation of JSON data, emitting data as soon as some piece of output has been built, discarding input that has been consumed, on the go. I must admit, that I am super proud of this one! https://github.com/gnieh/fs2-data/pull/426
Tonight I’m playing with #rq, a tool originally intended as a #jq replacement using #Rego as its query language, but which eventually grew to be useful for format transformations, and now a full-blown #scripting environment. All powered by #OPA. Madness, obviously, but just the right kind of madness.
Not so known #jq fact: Last stable release was in 2018 😬
Since then there has been lost of bug fixes and improvements but the maintainers ran out of interest and stream. There has been a few attempts at creating a new org that have stalled. But last week the original author stedolan show up and blessed the new org and transfer the repo to https://github.com/jqlang. We're currently working on cleaning up and fixing broken CI, etc and hopefully there will be a new release! 🥳