Hi
I have a json file something like this...
{"title": ["stuff"], "body": ["stuff"], "other": ["stuff"]}
{"title": ["stuff"], "body": ["stuff"], "other": ["stuff"]}
{"title": ["stuff"], "body": ["stuff"], "other": ["stuff"]}
I'm new to json and I've been testing out paths using this online helper http://michaelfarmer.info/jsonpath/
Once I've created my importer and then visiting the /import form, I'm asked to enter the context and the jsonpaths to run.
Where it says "This is the base query, all other queries will run in this context." I entered "$.*" (without the quotes)
Where it says "The JSONPath expression to run." I've tried "$.body", ".body", and "body"
I can't seem to work out what the correct input should be.
Can someone please advise?
Much appreciated,
cheers
scotjam
Comments
Comment #1
scotjam commentedMy mistake!
I'm using a variation of json format called json lines.
Oops!
Don't suppose its possible to parse this format with some code changes, is it?
p.s. please feel free to close at any time.
cheers
scotjam
Comment #2
twistor commentedI did some searching and couldn't find any documentation for the format except for http://doc.scrapy.org/topics/exporters.html#scrapy.contrib.exporter.Json.... Do you have any other docs?
Comment #3
scotjam commentedOnly this from MongoDB...
http://www.mongodb.org/display/DOCS/Import+Export+Tools
It's easy to convert them to json format. I just open the file in a text editor and replace all '}\n{' with '}, {' and add '[' to the start and ']' to the end.
I was thinking I could make some code changes to the parser, for it to look more kindly at this structure
cheers
scotjam
Comment #4
twistor commentedComment #5
twistor commentedI've made an initial commit for this. Whenever the dev release shows up, this should be in it.
http://drupal.org/cvs?commit=434614
Comment #6
scotjam commentedjust brilliant.
thank you for this.
scotjam
Comment #7
twistor commentedI'm guessing this is working. Any problems, open a new issue.