Feeds JSONPath Parser
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
This project is in maintenance mode. No new features will be added. 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
The file jsonpath.php must be downloaded and put in the 'sites/all/libraries/jsonpath' folder. After installing the module, clear your cache so that the parser will be available in Feeds.
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
