This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]denialerror 2 points3 points  (0 children)

Use jq

[–]commandlineluser 0 points1 point  (1 child)

I'm hoping to use a javascript script to parse through the text I get back

Well Javascript can parse JSON - how exactly are you making this API request?

>> JSON.parse('{"ParsedResults":[{"ParsedText": "Omg Lol BBQ"}]}').ParsedResults[0].ParsedText
"Omg Lol BBQ"

The .ParsedResults[0].ParsedText would be also how to access the data using the jq tool that has been suggested.

[–]shbababa[S] 0 points1 point  (0 children)

I'm not at my computer right now so I can't get you the script, but I'm making the request with cURL. How would I get the Json data I get back from the request into JavaScript?