Reputation:
I am tracking some keywords on Twitter using the command below. I want to print just the "screen_name" property of the tweet author. I could get the command below working but want to remove "quotes" from the author screen_name. How could I do this?
curl -N -d @tracking http://stream.twitter.com/1/statuses/filter.json \
-umyuser:mypass | \
sed -e 's/[{}]/''/g' | \
awk -v RS=',"' -F: '/^screen_name/ {print $2}'
Upvotes: 36
Views: 79054
Reputation: 251
cat a.txt | tr -d "\042"
It is better because it works in Windows too (using gnuwin32)
Upvotes: 0
Reputation: 3144
A little late to the party, this this utility sounds like it can be useful for parsing the json twitter returns: http://stedolan.github.io/jq/
Upvotes: 1