@m2m, I figured out how to process incoming #webmentions locally instead of using #javascript.
First step is to #curl a #webmentions feed:
curl "https://webmention.io/api/mentions.json?token=${API_KEY}"
Next, I use #jq and #yq in a gnarly shell script to create #YAML files for each post.
https://git.sr.ht/~starbreaker/starbreaker.org/tree/main/item/get-webmentions.sh
If a post has webmentions, my "to-html.sh" script will feed them into #pandoc and my custom template will do the rest.
https://git.sr.ht/~starbreaker/starbreaker.org/tree/main/item/to-html.sh
https://git.sr.ht/~starbreaker/starbreaker.org/tree/main/item/template.html
#pandoc #yaml #yq #jq #curl #javascript #webmentions
Removing nulls from a JSON object with #jq, some notes on same
https://vielmetti.typepad.com/logbook/2023/04/removing-nulls-in-a-json-structure-with-jq.html
prompted by @fasterthanlime and saved to a blog so that bit of ephemera could be incrementally easier to find.
with a bonus mention of #yq https://mikefarah.gitbook.io/yq/ which is like jq for YAML, if your life revolves around YAML.
Whoop whoop - yq is kinda "jq for yaml" :
https://mikefarah.gitbook.io/yq
Bonus : yq ist able to transform json to yaml and vice versa 🤟
Whoop whoop - yq is kinda "jq for yaml" :
https://mikefarah.gitbook.io/yq
Bonus : yq ist able to transform json to yaml and vice versa 🤟
I spent part of the end of year holiday attempting to learn some Go and get my SQL on. Well not MySQL but SQLite. I just wrote up some things I learned about common table expressions (CTEs), and my complete ineptitude at some aspects of command-line data processing. It's not always pretty, but If The Learn Don't Burn (?!!) are you really learning?
https://bitsby.me/2023/02/tracking-program-investments-in-sqlite/
#learning #sql #commandline #nopainnogain #sqlite #yq
I don't know if I'm learning #jq syntax or just making a collection of usable queries, but here's one for yaml from today.
To pull the #kubectl config for the user(s) with "prod" in the name:
yq '.users.[] | select(.name|contains("prod"))' $home\.kube\config
That's https://github.com/mikefarah/yq
#yq doesn't (yet) support _all_ of jq's syntax, but it supports everything I've needed, and it works on yaml AS WELL AS on json...
Note to myself: start utilizing #yq for extracting info from #k8s yaml, or modifting them... Handy tool for #yaml data, like #jq for json. #openshift https://betterprogramming.pub/my-yq-cheatsheet-34f2b672ee58
@skunksarebetter If you do a lot of work around #K8s, #yq should definitely be in your digital toolbox!
#Kubernetes
#TodayILearned about #yq and especially #xq for parsing #YAML and #XML from the command-line as if it were #JSON parsed with #jq.
yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents by Andrey Kislyuk
#CLI #CommandLine #CommandLineInterface #terminal #tools #TIL
#todayilearned #yq #xq #yaml #xml #json #jq #cli #commandline #commandlineinterface #terminal #tools #til