Created
January 31, 2015 02:23
-
-
Save jdanbrown/e5eb97e76ff0359d15d9 to your computer and use it in GitHub Desktop.
Scrape spark-1.2.0 /environment using pup + jq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ for header in 'Runtime Information' 'Spark Properties' 'System Properties' 'Classpath Entries' ; do pbpaste | pup 'h4:contains("'"$header"'") > table tr json{}' | jq '{"key":"'"$header"'", "value":[.[].children | {key:.[0].text, value:.[1].text}] | .[1:] | from_entries}' -c ; done | jq --slurp '. | from_entries' --sort-keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment