I'm trying to parse json returned from a curl request, like sp:
curl 'http://twitter.com/users/username.json' | sed -e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}'
I have it set working where it splits the json into fields, i.e. the above returns
% ...
"geo_enabled":false
"friends_count":245
"profile_text_color":"000000"
"status":"in_reply_to_screen_name":null
"source":"web"
"truncated":false
"text":"My status"
"favorited":false
% ...
But what I would like to do is grab a specific field (denoted by the -v k=text) and only print that.
Any ideas?