View Single Post
Old 08-08-2013, 06:24 PM   #534
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
Stock Lua libraries on K5 includes JSON library.

Quote:
Originally Posted by /usr/lib/lua/json.lua
Code:
-- USAGE:
-- This module exposes two functions:
--   encode(o)
--     Returns the table / string / boolean / number / nil / json.null value as a JSON-encoded string.
--   decode(json_string)
--     Returns a Lua object populated with the data encoded in the JSON string json_string.
Code:
[root@kindle root]# lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require"json"
> print(json.encode({hello="world"}))
{"hello":"world"}
> print(json.decode('{"hello":"world"}').hello)           
world
Also there is stock /usr/lib/libcjson.so (docs), if you have a time to write information extractor in C.
eureka is offline   Reply With Quote