Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 1005 Bytes

README.rdoc

File metadata and controls

36 lines (21 loc) · 1005 Bytes

Jazor

Jazor is a simple command line JSON parsing tool.

Installation

gem install jazor

General usage

jazor [options] [source] [slice]
  • The source option refers to a file, URL or string containing JSON data. Jazor also accepts input from STDIN.

  • The slice option refers to the piece of JSON data you’re interested in. This is usually just the name of an attribute, but you can also access it like a hash (e.g. json), or if the JSON object is an array, like an array (e.g. json, etc.).

Examples

Reading the entire JSON object from a URL

jazor 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=jazor'

Reading a JSON “slice” from a URL

jazor 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=jazor' responseData.results[0].title

Testing the value of a JSON “slice”

jazor 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=jazor' -t 'responseData.results.is_a?(Array)'

Help

jazor --help