Here is the command with jq instead of json_pp
$ curl -sS 'https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=aurora' | jq . | gsed -nE '/<\/?b>/{s```g;s`"|,|^ *``g;p}'
(see my other comment about gsed vs sed)
Re:Show HN: Anycomplete
by kevinastone on Wednesday November 30, 2016 @12:08AM
(#13068623)
You don't need sed, you can do it all in jq:
curl -sS 'https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=aurora' | jq -r '.[1] | .[][0] | sub("</?b>"; ""; "gi")'Here's the above modified to work with BSD sed:
curl -sS 'https://www.google.com/complete/search?client=hp&hl=en&xhr=t&q=aurora' | jq . | sed -nE '/<\/?b>/{s```g;s`"|,|^ *``g;p;}'
(Edited to remove previous advice about inserting a newline)
[0]: https://stedolan.github.io/jq/