FLOX_advocate, to Seattle
@FLOX_advocate@floss.social avatar

I'm giving two talks at tomorrow (Sunday)

Mastodon and the Fediverse: Decentralized Social Networking and Services at 10:00

https://lfnw2024.sessionize.com/session/603213

Intro to jq: grep for JSON at 11:00

https://lfnw2024.sessionize.com/session/603215

I will be remote, but @SeaGL is on site and looking for volunteers for our November conference in

@lfnw

snonux, to random
@snonux@fosstodon.org avatar

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

kubikpixel, to webdev
@kubikpixel@chaos.social avatar

Awesome jq

A curated list of awesome things built with the JSON processor and turing-complete functional language jq.

./jq https://github.com/fiatjaf/awesome-jq


jamesog, to random
@jamesog@mastodon.social avatar

“DuckDB as the New jq” is a short but good read. I'd heard of DuckDB but not looked into it. This is a cool use-case.

https://www.pgrs.net/2024/03/21/duckdb-as-the-new-jq/

btaroli,
@btaroli@federate.social avatar

@jamesog thanks for sharing this! I’m going to have to play with it. I have some complex #JSON cases that might really benefit. I also see promise in cases where today I might translate #XLSX to #CSV and then import into #SQLite. Why do all that if I can query the original directly? Awesome!

#DuckDB #jq

nurkiewicz, (edited ) to random
@nurkiewicz@fosstodon.org avatar

Am I the only one still preferring , and over desktop tools like ? Findings like that aren't helpful: https://www.leeholmes.com/security-risks-of-postman/

jbrains, to random
@jbrains@mastodon.social avatar

Trying to do something like with

I'm using Golden Master technique and I've committed the expected output to git.

This is "assert all remains well" while refactoring:

git diff --exit-code --quiet Testing/; if (( $? )) then; echo "FAIL"; else; echo "OK"; fi

gnulinux, to linux German
@gnulinux@social.anoxinon.de avatar

JSON Query - Teil 2

Wie filtert man mit dem Werkzeug jq und stellt mehrere Werte in einer Zeile dar? Ein Artikel aus dem beruflichen Alltag.

#JSON #jq #Abfrage #Query #Linux

https://gnulinux.ch/json-query-teil-2

wjmaggos, to random
@wjmaggos@liberal.city avatar

Adam is worried about what others said on NAS dooming his campaign, while he's said a million things himself on the podcast that will ruin his chances. He sees these problems in others that are exactly what he is guilty of. That old Dutch saying again. He doesn't need god, he needs therapy. But it's ok, even if he loses, he'll claim the election was stolen by aliens and the WEF. And most of his listeners will believe him. Let's just hope nobody gets shot.

amerika,

@wjmaggos

Am I the only podcast listener who thinks highly of Adam and John and believes they are essentially honest?

I think he is willing to stand up for what he believes, but does not want to be lumped in with the crowd or some of the normtard Republicans.

mjgardner, to programming
@mjgardner@social.sdf.org avatar

@Perl Happy 36th to the language!

v1.0 then:
“Perl is kind of designed to make and semi-obsolete […] The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).” https://github.com/Perl/perl5/releases/tag/perl-1.0

v5.38.2 now:
“Perl is […] now used for a wide range of tasks including , , network programming, development, and more.” https://perldoc.perl.org/perlintro#What-is-Perl%3F

mjgardner,
@mjgardner@social.sdf.org avatar

@sjfloat @Perl When you get tired of escaping metacharacters in your and pipelines, when you get tired of inventing new ways to pass structured data between small tools as text streams, is there.

Of course, you can take that last point too far. See or even , where half the “fun” is marshalling between bespoke data structures.

wader, to haskell
@wader@fosstodon.org avatar
fedora, to linux
@fedora@fosstodon.org avatar

Learn how to write a text user interface (TUI) for yourself! Could be a nice way to smooth out your workflow in the terminal.

➡️ https://fedoramagazine.org/writing-useful-terminal-tui-on-linux-with-dialog-and-jq/

arda, to rust
@arda@micro.arda.pw avatar

Jaq:

A jq clone focussed on correctness, speed, and simplicity, written with rust

https://github.com/01mf02/jaq

annathepiper, to wordpress
@annathepiper@mastodon.murkworks.net avatar

Followup on this thread I posted earlier:

https://mastodon.murkworks.net/@annathepiper/111467755713006541

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.

Recommendations solicited. /1

mjgardner, to vscode
@mjgardner@social.sdf.org avatar

Do you want a script using (https://jqlang.github.io/jq) and https://github.com/microsoft/vscode-vsce to document your workspace extension recommendations as a list? Sure you do:

for extName in $( jq --raw-output '.recommendations[]' <.vscode/extensions.json )  
do  
 vsce show --json "${extName}" |  
 jq --raw-output '  
 ["* [", .displayName, "](",  
 @uri "<https://marketplace.visualstudio.com/items?itemName=>\(  
 "\(.publisher.publisherName).\(.extensionName)"  
 )",   
 ")"] | add'  
done  
nurkiewicz, to javascript
@nurkiewicz@fosstodon.org avatar

jqp: a playground for exploring : https://github.com/noahgorstein/jqp

iooioio, to random
@iooioio@fosstodon.org avatar

Just found out about . Like but for html. Perfect for scraping websites in combination with !

https://github.com/mgdm/htmlq

mnw, to TodayILearned

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

qmacro, to random
@qmacro@hachyderm.io avatar

Ok folks, I decided to work openly on my Community Theatre talk at and start writing my notes in the shape of a long-form article. All critiques welcome. Share & enjoy! (And caution: WIP!)

"Handle JSON like a boss with "
https://github.com/qmacro/teched-jq-talk

FLOX_advocate, to Seattle
@FLOX_advocate@floss.social avatar

I'll be talking about jq and JSON @SeaGL on Saturday, November 4th

I'm flying up to Seattle to be masked and in person. We're hybrid this year, so you can watch our talks remotely

This is part 3 of my jq trilogy, "Advanced jq: awk for JSON"

https://osem.seagl.org/conferences/seagl2023/program/proposals/950

because I'm looking forward to a fantastic meal while in town :)

nev, to random
@nev@bananachips.club avatar

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?

:boost_ok:

salcode, to composer
@salcode@phpc.social avatar

I've been using the command line tool a lot lately. One thing I'm enjoying is using it to extract data from composer.json

I made some notes about code I use to find a dependency and copy it to the clipboard when I don't remember the full name.

https://salferrarello.com/find-dependency-in-composer-json-with-jq/

bortzmeyer, to random French
@bortzmeyer@mastodon.gougere.fr avatar

Proposition de Captcha : demander au visiteur d'écrire un programme en 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.

jschauma, to random
@jschauma@mstdn.social avatar

I've previously[1] talked about how stupid is, and while is an improvement, it's still really just a bunch of information bits based on (regional) convention.

A human can usually quickly identify e.g., the owning legal entity from inspection of of the data, but good luck doing that programmatically. It's infuriating.

[1] https://www.netmeister.org/blog/whois.html

bortzmeyer,
@bortzmeyer@mastodon.gougere.fr avatar

@jschauma Just for fun, here is a script to extract the registrant (but, as you noticed, the biggest problem is in the lack of consistency of data):

.entities [] | select(.roles[] | select(. == "registrant")) | .vcardArray[1] | map(select(.[0] == "fn"))[0][3]

Use it like:

curl -s https://rdap.nic.fr/domain/egis.fr | jq -f rdap.jq

lucassatabin, to random
@lucassatabin@fosstodon.org avatar

This has been a long dream of mine, since I added JSON support in -data. And it has never been so close to become true: the PR adding support for queries (think ) 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

clux, to rust

quick releases of the rewrite of yq (a multi-format wrapper) at https://github.com/clux/whyq

now handles all of jq's syntax, raw/compact/joined output, yaml/json/toml inputs & outputs, with jq module re-use for all formats!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • normalnudes
  • tsrsr
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • hgfsjryuu7
  • Youngstown
  • InstantRegret
  • slotface
  • khanakhh
  • rosin
  • ngwrru68w68
  • kavyap
  • PowerRangers
  • Leos
  • tacticalgear
  • cubers
  • everett
  • vwfavf
  • ethstaker
  • osvaldo12
  • Durango
  • mdbf
  • modclub
  • cisconetworking
  • GTA5RPClips
  • tester
  • anitta
  • All magazines