This project will have no further development. No new features will be added. Only major breaking bugs will be fixed. New installs should use Feeds extensible parsers instead.
Features
This is a parser for the Feeds module that allows parsing JSON using JSONPath. It is very similar to the Feeds XPath Parser module.
Installation
Download https://github.com/FlowCommunications/JSONPath/archive/0.5.0.tar.gz and place the contents of JSONPath-0.5.0 in sites/all/libraries/jsonpath and enable the modules libraries and xautoload.
Documentation
Documentation can be found at http://goessner.net/articles/JsonPath/, and http://code.google.com/p/jsonpath/wiki/PHP.
** The syntax is different for the @ operator. In the documentation, examples look like @.name. That syntax changes to @['name'] since this is PHP and not Javascript.
Example
Starting with the JSON document:
{ "store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{ "category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{ "category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
Assuming you have JSONPath expressions mapped to the Title, and Author fields, your expressions would look like:
Context: $.store.book.*
Title: title
Author: author