Skip to content

Instantly share code, notes, and snippets.

@jdanbrown
Created January 31, 2015 02:23
Show Gist options
  • Save jdanbrown/e5eb97e76ff0359d15d9 to your computer and use it in GitHub Desktop.
Save jdanbrown/e5eb97e76ff0359d15d9 to your computer and use it in GitHub Desktop.
Scrape spark-1.2.0 /environment using pup + jq
$ 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