cat earthporn.json | \
jshon -e data -e children -a -e data -e title -u | \
sed -r 's/\<./\U&/g' | tr -d ' ' | sed 's/[^a-zA-Z].*//g`
I'll stick with Jshon for my routers and other little ARM devices.
But this utility is pretty nifty. Personally the whole select thing feels a little too magic for my taste, but when it works it looks quite compact. I'll probably be borrowing that colorizing feature tomorrow. And thanks for the link at the bottom :-)
What's the ?ref=hn in the URL about? I'm intrigued if there's some way to track this sort of thing at GitHub. Or was it just to get around its two previous posts? ;-) (Not that I can blame you for that, gotta keep trying.)
I might be wrong but I don't think you can access your Github repo's analytics. The only reason I can think off other than the one you mentioned is that if the link gets reposted to forums/blogs, he knows the source of it as HN.
Thanks! I put this tool together to tackle a bunch of common tasks I had - groveling through large JSON responses from webservices, using templates to generate documents based on structured config data, etc. I'm really happy that other people are finding it useful too. If you have any feature requests, post them!!!
Did you read the fucking article? The application began as a simple CLI for executing JS, and had underscore as its standard library. So it was a CLI for underscore. Then they made it JSON focused.
The author says:
"Or it can form the backbone of a rich, full-powered Javascript command-line, inspired by "perl -pe", and doing for structured data what sed, awk, and grep do for text."
But... "structured data", at least in his examples (and nearly all the JSON I see on the web), is... text. Does his perl script handle binary json?
The author says:
"Try doing THAT with any other CLI one-liner!"
Indeed I will, since I do not know perl. Should I learn it?
The folllowing seems to work, but I only tested it on the author's earthporn.json example
1. compile CamelCase filter called yycamel
2. compose throwaway sed oneliner to massage the text
3. pipe through unicode to ascii filter (not included)
Does anyone have a javascript deobfuscation tool that will autorename variables in different scopes? I love working with javascript through the shell, but js-beautify doesn't always cut it.
Challenge accepted.
I'll stick with Jshon for my routers and other little ARM devices.But this utility is pretty nifty. Personally the whole select thing feels a little too magic for my taste, but when it works it looks quite compact. I'll probably be borrowing that colorizing feature tomorrow. And thanks for the link at the bottom :-)