tags:

views:

85

answers:

4
{ members: [
    [
        {
            c1: [{fft: 5,v: '[email protected]'}],
            c2: [{fft: 9,v: 'tst'}],
            c3: [{sft: 1,v: 'Corporate Member'}]},
        {
            c1: [{fft: 5,v: '[email protected]'}],
            c2: [{fft: 9,v: 'asd'}],
            c3: [{sft: 1,v: 'Company'}]}

        ...etc

What is this JSON format? The full version is here: http://the.freshapricot.com/Content/Members/MemberDirectory/MemberDirectoryWebService.asmx/LoadMembers?memberDirectoryPageId=542132.

It just doesn't look like any other JSON I've seen. I would be very thankful for a pointer in the right direction to parse this. So long as it's not just regex it, which I'm sure is possible but not something I can accomplish.

A: 

You would probably be best off using a standard JSON library to parse it. A full list, organized by platform, is available at the json.org site.

eswald
A: 

Judging by this question and its followup on the Wild Apricot forums, you're poking at an undocumented tool primarily intended for internal use. Your best bet is to leave it alone. Your second-best bet is to hack at an existing parser in whatever language you are handling this with so that the parser tolerates unquoted keys.

Brian Wisti
+4  A: 

This appears to be the result of an ASP .NET web service based on the .asmx in the URL. What looks non-standard to me (based on the http://www.json.org/ definition) is the lack of double-quotes around the keys, and single-quotes instead of double-quotes wrapping the string values. E.g. v: '[email protected]' should be "v": "[email protected]". I believe this is object literal notation of JavaScript (http://www.dyn-web.com/tutorials/obj_lit.php) rather than strict JSON, which is itself a subset of object literal notation.

How you choose to parse it could depend on what language/platform constraints you have, but I believe JavaScript will handle it. For an example, see this JSON/JavaScript code on Google Code Playground: http://code.google.com/apis/ajax/playground/#json_data_table. It constructs a JSON object using object literal notation for its visualization service.

Chris B.
A: 

That's not JSON. It actually looks like a lua source code encoding of the data. But if it is undocumented, it could be anything, so you're probably not going to be able to handle it reliably.

Andrew McGregor