Skip to content

Instantly share code, notes, and snippets.

@tingletech
Last active July 15, 2018 22:39
Show Gist options
  • Save tingletech/9823267 to your computer and use it in GitHub Desktop.
Save tingletech/9823267 to your computer and use it in GitHub Desktop.
curl --silent https://gist.githubusercontent.com/tingletech/9823267/raw/163e5494fb0f2abe228a959ccd66e8bcb75a7c75/jq.json \
  | jq ".[0].from_user"
"_AaronNg"

It is still quoted, sure, but that has not stopped me from using the output in scripts / xargs.

[
{
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and <canvas>.\nhttp://t.co/XRvh1ZVw",
"from_user": "_AaronNg"
},
{
"text": "RT @_kud: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and <canvas> -- http://t.co/Lhp92IqD",
"from_user": "blouerat"
},
{
"text": "Dynamic Forms Mobile App by pmadiset: Few Forms details are hosted on our server in the form of JSON. This JSON ... http://t.co/7KALdWaX",
"from_user": "cebu_iphone"
},
{
"text": "iPhone 5 website insanity - Video compressing using JPEG, JSON, and <canvas> http://t.co/28Jesbio (Oh #Apple, U So #Awesome...)",
"from_user": "dieswaytoofast"
},
{
"text": "RT @umutm: A very nice web-based JSON editor - http://t.co/M70snaIf",
"from_user": "Leolik"
}
]
@adriantorrie
Copy link

Thanks for this

@Anthonie-Smit
Copy link

You can use the -r argument for removing the quotes:
curl --silent https://gist.githubusercontent.com/tingletech/9823267/raw/163e5494fb0f2abe228a959ccd66e8bcb75a7c75/jq.json | jq -r ".[0].from_user"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment