Parsing JSON object in Lua

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Parsing JSON object in Lua

Muqtheear S
Hi all,
        I have a JSON object as a web response. If there is already a lua script written to parse a JSON object, please share with me else suggest me how to parse.

Thanks & Regards,
Muqtheear.S
Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON object in Lua

Luiz Henrique de Figueiredo
>         I have a JSON object as a web response. If there is already a lua
> script written to parse a JSON object, please share with me else suggest me
> how to parse.

See this thread: http://lua-users.org/lists/lua-l/2011-10/msg01039.html
and also https://github.com/harningt/luajson for instance.

Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON object in Lua

Laurent FAILLIE
In reply to this post by Muqtheear S
Hi,

Le 10/05/2013 05:46, Muqtheear S a écrit :
> Hi all,
>         I have a JSON object as a web response. If there is already a
> lua script written to parse a JSON object, please share with me else
> suggest me how to parse.

Have a look on my very own project named Vigie :
http://sourceforge.net/projects/vigie/
It's a customer for both SOAP and JSON web service.

There is no documentation yet but the source I think is clear enough,
and you have as well to navigate thru the SVN repo as I didn't released
yet any file bundle.
JSon code is in .../Protocols/REST.lua

Bye

Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON object in Lua

Laurent FAILLIE
Have a look on my very own project named Vigie :
http://sourceforge.net/projects/vigie/
It's a customer for both SOAP and JSON web service.

There is no documentation yet but the source I think is clear enough,
and you have as well to navigate thru the SVN repo as I didn't released
yet any file bundle.
JSon code is in .../Protocols/REST.lua

Oups, even REST layer is using XML documents ... sorry for the confusion.

My main application, Domestik (http://sourceforge.net/projects/domestik/) has switched to JSon as it is more resource conservative vs XML.

I'm using the great dkjson to send figures and alert from my monitors and the code can be found in http://sourceforge.net/p/domestik/code/HEAD/tree/Client/dmkcheckd
(sending code only).

Thanks to Dunkan for pointing this out.

Bye

Laurent
Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON object in Lua

Marc Balmer
In reply to this post by Muqtheear S
Am 10.05.13 05:46, schrieb Muqtheear S:
> Hi all,
>         I have a JSON object as a web response. If there is already a
> lua script written to parse a JSON object, please share with me else
> suggest me how to parse.

Mine is here: https://github.com/mbalmer/luajson



Reply | Threaded
Open this post in threaded view
|

Re: Parsing JSON object in Lua

David Heiko Kolf-2
In reply to this post by Muqtheear S
Muqtheear S wrote:
> Hi all,
>         I have a JSON object as a web response. If there is already a
> lua script written to parse a JSON object, please share with me else
> suggest me how to parse.

There are quite a lot of JSON modules for Lua already and after adding
yet another one to them (and afterwards realizing just how many there
are already) I started this list and comparison of JSON modules:
<http://lua-users.org/wiki/JsonModules>.

I haven't updated it for quite some time though, so it probably does not
reflect the newest versions and some modules are not in the comparison
at all yet.

For decoding I would check that the module supports Unicode escape
sequences at least in the BMP (0 to 0xFFFF) and preferably also beyond
it.  Many modules can do so.

For encoding most modules support the minimum characters that should be
encoded.  If you want to use the JSON output directly in JavaScript
("JSONP"), further characters have to be escaped.

Best regards,

David Kolf