Reputation: 35
To start off: I am not familiar with JSON. I think I understand its purpose and formatting, but I'm not trying to be an expert on the subject (and it would seem as though it isn't a very hard 'subject' to master).
But I've run into a problem. I've been trying to download this option data from google, and I'm forced to download it in JSON format. That's fine and all, and I was just going to run it through a python script anyways, so I don't mind it's format. But, I can't get it to work. After reading into all the errors I've been running into, it would seem as though this data isn't formatted correctly. I'm led to assume that this isn't a JSON file at all, but if it's not, then I don't know what to do with it.
Any help would be appreciated. I can't seem to find any resources on this that doesn't just say that this isn't JSON.
I should also point out that, from my naive familiarity with JSON formatting, it would seem as though the problem is that there are strings without double quotes around them. If this is the only issue, then I would wonder why google wouldn't just fix it, so I'm assuming there is something else at play here.
Upvotes: 0
Views: 56
Reputation: 540
Admittedly this might not have been the original author's intention but this is actually valid CSON, CoffeeScript's version of JSON. I went ahead and tried cson2json
from the cson npm package on the file and it worked out great. Here's the JSON on pastebin.
If you want to do the same yourself in an automated manner you can simply use the cson library, that should cover everything for you.
Upvotes: 2