Hi,
i play with dropbox and I get results like
t = ‘{“revision”: 7, “rev”: “707b638c6”, “thumb_exists”: false, “bytes”: 36, “modified”: “Fri, 24 Jan 2014 03:07:54 +0000”, “client_mtime”: “Mon, 14 May 2012 18:56:57 +0000”, “path”: “/mydays_b_12132012120312.txt”, “is_dir”: false, “icon”: “page_white_text”, “root”: “dropbox”, “mime_type”: “text/plain”, “size”: “36 bytes”}, {“revision”: 9, “rev”: “907b638c6”, “thumb_exists”: false, “bytes”: 36, “modified”: “Fri, 24 Jan 2014 03:08:03 +0000”, “client_mtime”: “Mon, 14 May 2012 18:56:57 +0000”, “path”: “/mydays_b_12122012120314.txt”, “is_dir”: false, “icon”: “page_white_text”, “root”: “dropbox”, “mime_type”: “text/plain”, “size”: “36 bytes”}, {“revision”: 12, “rev”: “c07b638c6”, “thumb_exists”: false, “bytes”: 36, “modified”: “Fri, 24 Jan 2014 18:51:43 +0000”, “client_mtime”: “Mon, 14 May 2012 18:56:57 +0000”, “path”: “/mydays_b_12132012120319.txt”, “is_dir”: false, “icon”: “page_white_text”, “root”: “dropbox”, “mime_type”: “text/plain”, “size”: “36 bytes”}’
i would like to extract all ‘path’ so as result i have
/mydays_b_12132012120312.txt
/mydays_b_12122012120314.txt
/mydays_b_12132012120319.txt
i tried like
local decode = json.decode( t )
print( decode.path ) but only get the first Path extracted…
any ideas
also i could work with another result
t = ‘{“hash”: “c6e5643fe351d4a59b4b3cb61bdfb870”, “thumb_exists”: false, “bytes”: 0, “path”: “/”, “is_dir”: true, “size”: “0 bytes”, “root”: “app_folder”, “contents”: [{“revision”: 1, “rev”: “107b638c6”, “thumb_exists”: false, “bytes”: 36, “modified”: “Mon, 14 May 2012 18:56:57 +0000”, “client_mtime”: “Mon, 14 May 2012 18:56:57 +0000”, “path”: “/backup.txt”, “is_dir”: false, “icon”: “page_white_text”, “root”: “dropbox”, “mime_type”: “text/plain”, “size”: “36 bytes”}, {“revision”: 9, “rev”: “907b638c6”, “thumb_exists”: false, “bytes”: 36, “modified”: “Fri, 24 Jan 2014 03:08:03 +0000”, “client_mtime”: “Mon, 14 May 2012 18:56:57 +0000”, “path”: “/mydays_b_12122012120314.txt”, “is_dir”: false, “icon”: “page_white_text”, “root”: “dropbox”, “mime_type”: “text/plain”, “size”: “36 bytes”}, {“revision”: 7, “rev”: “707b638c6”, “thumb_exists”: false, “bytes”: 36, “modified”: “Fri, 24 Jan 2014 03:07:54 +0000”, “client_mtime”: “Mon, 14 May 2012 18:56:57 +0000”, “path”: “/mydays_b_12132012120312.txt”, “is_dir”: false, “icon”: “page_white_text”, “root”: “dropbox”, “mime_type”: “text/plain”, “size”: “36 bytes”}], “icon”: “folder”}’
but does not seem easier.
would be great u could give me a solution for both… to finally get all ‘path’ results
thanks a lot
chris