Re: [WebDNA] WebDNA development

This WebDNA talk-list message is from

2017


It keeps the original formatting.
numero = 113743
interpreted = N
texte = 1338 --001a113946dcc5ee35055ed039e5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, Just to finish this off. Here's a function to pull a value from a JsonObject when you know the node name. If anyone can improve on this that would be great. - Tom [!] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ FUNCTION Name: smGetJsonValue ** Description: Pull out a value from a JSONobject ** Input: jsonObject =3D (the json to be parsed) - required jsonNode =3D (the node that we the value of) - required ** usage: [smGetJsonValue jsonObject=3D[url][/url]&jsonNode=3D] [/!][function name=3DsmGetJsonValue][!] [/!][text]tReturn=3D[/text][!] [/!][text]tJsonObject=3D[/text][!] [/!][text]tJsonNode=3Dnull[/text][!] [/!][showif [url][params_string][/url]^jsonObject][text]tJsonObject=3D[jsonObject][/tex= t][/showif][!] [/!][showif [url][params_string][/url]^jsonNode][text]tJsonNode=3D[jsonNode][/text][/sh= owif][!] ### Store the jsonObject in a table ### [/!][jsonstore table=3DjsonOject][tJsonObject][/jsonstore][!] ### Search the table ### [/!][search table=3DjsonOject&ne[tJsonNode]data=3Dfind_all][founditems][!] [/!][text]tReturn=3D[interpret][[tJsonNode]][/interpret][/text][!] [/!][/founditems][/search][!] ### Return the value ### [/!][return][tReturn][/return][!] [/!][/function] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D On 25 November 2017 at 14:50, Tom Duke wrote: > Chris, > > Hi - finally coming back to this. > > The [convertwords] idea does not work as each node in the table / databas= e > created by [jsonstore] is added as a field. So we don't have a 'from,to' > field structure. > > I also can't seem to use [listfields] with a table. So the only option i= f > you don't know the structure of the JSONobject is to use [jsonstore] to > create a database on disk and then use [listfields] on that to traverse t= he > JSONobject. > > Something like this is needed just to see the values from the JSONobject > > [jsonstore db=3Djsonparse.db]JSONobject[/jsonstore] > [listfields db=3Djsonparse.db] > [showif [index]=3D1] > [text]node-1-name=3D[fieldname][/text] > [/showif] > [/listfields] > [search db=3Djsonparse.db&ne[node-1-name]data=3Dfind_all][founditems] > [listfields db=3Djsonparse.db] > [fieldname]=3D[interpret][[fieldname]][/interpret] > [/listfields] > [/founditems][/search] > > The 'jsonparse.db' then has to be zero'd out after each [jsonstore], or > new data get appended to it. Alternatively we name the database somethin= g > like jsonparse-[cart].db to ensure they are unique, but we end up litteri= ng > the disk with databases. > > In the context of dealing with json from an api or ajax call it seems lik= e > a lot of overhead to traverse a json response. > > Take care > - Tom > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Digital Revolutionaries > 1st Floor, Castleriver House > 14-15 Parliament Street > Temple Bar,Dublin 2 > Ireland > ---------------------------------------------- > [t]: + 353 1 4403907 <(01)%20440%203907> > [e]: > [w]: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > On 6 March 2017 at 10:21, wrote: > >> Hi Tom! I suppose you could try something like this: first, create the >> table, something like this should work fine >> >> [JSONstore table=3DtabJSONPARSE] >> JSONobject >> [/JSONstore] >> >> you do not need to know the exact structure of the incoming JSON >> response, WebDNA will do it for you (I have personally not tested with a >> table, but it does with a db) >> >> Then, you can use [convertwords]: >> >> [convertwords table=3DtabJSONPARSE]error:type and >> error:message[/convertwords] >> >> This should work=E2=80=A6 >> >> - chris >> >> >> > On Mar 4, 2017, at 16:59, Tom Duke wrote: >> > >> > Chris, >> > >> > Hi - I'm using [jsonstore] and it's great to have it. It's not a >> flexible as [xmlparse] though. >> > >> > So if I want to pull out the error message from a Stripe.com json >> response I have to do the following: >> > >> > [table name=3DtabJSONPARSE&fields=3DtID,e >> rror:type,error:message][/table][!] >> > [/!][jsonstore table=3DtabJSONPARSE][varSTRIPER >> ESPONSE][/jsonstore][!] >> > [/!][search table=3DtabJSONPARSE&netIDdatarq >> =3Dfind_all][founditems][!] >> > [/!][text]error:type=3D[error:type][/text][!] >> > [/!][text]error:message=3D[error:message][/text]= [!] >> > [/!][/founditems][/search] >> > >> > Only then can I access the variable [error:message]. I also need to >> know the exact structure of the incoming JSON response so I can set up t= he >> table correctly. >> > >> > If we had similar functionality to [xmlparse] then I could do somethin= g >> like: >> > >> > [jsonparse var=3Djson_var1][varSTRIPERESPONSE][/jsonpar= se] >> > [jsonnode ref=3Djson_var1&path=3Dnamed:error >> :message][value][/jsonnode] >> > >> > It would also be great to be able to traverse the JSON response, >> particularly if we are not sure about the structure of the incoming JSON >> > >> > [jsonnodes ref=3Djson_var1] >> > [name]=3D[value] >> > [/jsonnodes] >> > >> > >> > - Tom >> > >> > >> > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > Digital Revolutionaries >> > 1st Floor, Castleriver House >> > 14-15 Parliament Street >> > Temple Bar,Dublin 2 >> > Ireland >> > ---------------------------------------------- >> > [t]: + 353 1 4403907 >> > [e]: >> > [w]: >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > >> > On 3 March 2017 at 15:27, wrote: >> > Hi Tom! WebDNA already includes a JSON parser, that takes any JSON >> Object, parse and store it: it will automatically create the database if= it >> does not exist, create the fields and populate it. >> > >> > http://www.webdna.us/page.dna?numero=3D307 >> > >> > From this, it is easy to use the data by treating the database (or >> table) like any other WebDNA database. >> > >> > best regards, >> > >> > - chris >> > >> > >> > >> > > On Mar 3, 2017, at 15:57, Tom Duke wrote: >> > > >> > > Chris, >> > > >> > > Hi - great to hear that you are working on this. >> > > >> > > The features that I would love to see are: >> > > >> > > >> > > [json_encode]{data}[/json_encode] >> > > >> > > It would operate the same as the matching PHP function: >> http://www.php.net/manual/en/function.json-encode.php >> > > >> > > So the data would be a WebDNA array and/or perhaps name/value pairs >> separated by line returns. Nested JSON would require some thought, some >> ideas here: http://stackoverflow.com/questions/15810257/create-nested- >> json-object-in-php >> > > >> > > >> > > [json_parse]{data}[/json_parse] >> > > >> > > It would operate in a similar way to [xmlparse] allowing us to >> traverse and extract the JSON data by node. Also similar to the PHP >> json_decode function: http://www.php.net/manual/en/f >> unction.json-decode.php >> > > >> > > >> > > >> > > - Tom >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > > Digital Revolutionaries >> > > 1st Floor, Castleriver House >> > > 14-15 Parliament Street >> > > Temple Bar,Dublin 2 >> > > Ireland >> > > ---------------------------------------------- >> > > [t]: + 353 1 4403907 >> > > [e]: >> > > [w]: >> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > > >> > > On 27 February 2017 at 14:24, >> wrote: >> > > Hello, >> > > >> > > we are interested to expand and develop the JSON capabilities and >> compatibility of WebDNA, particularly treating JSON-formatted returns fr= om >> javascript as well as submitting JSON-formatted info to external program= s >> and applications. >> > > >> > > If you have any related ideas, we are listening! :-) >> > > >> > > - chris--------------------------------------------------------- >> > > This message is sent to you because you are subscribed to >> > > the mailing list . >> > > To unsubscribe, E-mail to: >> > > archives: http://mail.webdna.us/list/talk@webdna.us >> > > Bug Reporting: support@webdna.us >> > > >> > > --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list . = To >> unsubscribe, E-mail to: archives: http://mail.webdna.us/list/tal >> k@webdna.us Bug Reporting: support@webdna.us >> > >> > --------------------------------------------------------- >> > This message is sent to you because you are subscribed to >> > the mailing list . >> > To unsubscribe, E-mail to: >> > archives: http://mail.webdna.us/list/talk@webdna.us >> > Bug Reporting: support@webdna.us >> > >> > --------------------------------------------------------- This message >> is sent to you because you are subscribed to the mailing list . To >> unsubscribe, E-mail to: archives: http://mail.webdna.us/list/tal >> k@webdna.us Bug Reporting: support@webdna.us >> >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> > > --001a113946dcc5ee35055ed039e5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

Just to finish this off.=C2=A0 = Here's a function to pull a value from a JsonObject when you know the n= ode name.

If anyone can improve on this that would= be great.

- Tom




[!]


=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FUNCTION Name: smGetJsonValue
=C2=A0 ** Description: Pull o= ut a value from a JSONobject
=C2=A0 ** Input:=C2=A0
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 jsonObject =3D (the json to be parsed) - required<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 jsonNode =3D (the node that we the va= lue of) - required
=C2=A0 ** usage:=C2=A0
=C2=A0 =C2=A0= =C2=A0 =C2=A0 [smGetJsonValue jsonObject=3D[url]<the-json-object>[/u= rl]&jsonNode=3D<the-json-node>]

[/!][fun= ction name=3DsmGetJsonValue][!]
[/!][text]tReturn=3D[/text][!]

[/!][text]tJsonObject=3D[/text][!]
[/!][text]tJson= Node=3Dnull[/text][!]

[/!][showif [url][params_string]= [/url]^jsonObject][text]tJsonObject=3D[jsonObject][/text][/showif][!]
=
[/!][showif [url][params_string][/url]^jsonNode][text]tJsonNode=3D[jsonNod= e][/text][/showif][!]

### =C2=A0Store the jsonObject i= n a table =C2=A0###

[/!][jsonstore table=3DjsonOje= ct][tJsonObject][/jsonstore][!]

### =C2=A0Search the t= able =C2=A0###

[/!][search table=3DjsonOject&n= e[tJsonNode]data=3Dfind_all][founditems][!]

[/!][text]= tReturn=3D[interpret][[tJsonNode]][/interpret][/text][!]

[/!][/founditems][/search][!]

### =C2=A0Retur= n the value =C2=A0###

[/!][return][tReturn][/retur= n][!]
[/!][/function]






=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D
Digital Revolutionaries
1st Floor, Castleriver = House
14-15 Parliament Street
Temple Bar,Dublin 2
Ireland
-----= -----------------------------------------
[t]: + 353 1 4403907
[e]: &= lt;mailto:tom@r= evolutionaries.ie>
[w]: <http://www.revolutionaries.ie/>
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

On 25 November 2017 at 14:50, Tom Duke <tom@revolutionaries.ie> wrote:
Chris,

Hi - finally coming back t= o this.

The [convertwords] idea does not work as e= ach node in the table / database created by [jsonstore] is added as a field= ..=C2=A0 So we don't have a 'from,to' field structure.

I also can't seem to use [listfields] with a table.=C2= =A0 So the only option if you don't know the structure of the JSONobjec= t is to use [jsonstore] to create a database on disk and then use [listfiel= ds] on that to traverse the JSONobject.

Something = like this is needed just to see the values from the JSONobject
[jsonstore db=3Djsonparse.db]JSONobject[/jsonstore]
=
[listfields db=3Djsonparse.db]
=C2=A0 =C2=A0 [showif [index]= =3D1]
=C2=A0 =C2=A0 =C2=A0 [text]node-1-name=3D[fieldname][/= text]
=C2=A0 =C2=A0 [/showif]
[/listfields]
[= search db=3Djsonparse.db&ne[node-1-name]data=3Dfind_all][foun= ditems]
[listfields db=3Djsonparse.db]
=C2=A0 =C2= =A0 [fieldname]=3D[interpret][[fieldname]][/interpret]
[/lis= tfields]
[/founditems][/search]

Th= e 'jsonparse.db' then has to be zero'd out after each [jsonstor= e], or new data get appended to it.=C2=A0 Alternatively we name the databas= e something like jsonparse-[cart].db to ensure they are unique, but we end = up littering the disk with databases.

In the conte= xt of dealing with json from an api or ajax call it seems like a lot of ove= rhead to traverse a json response.

Take care
=
- Tom




=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
Digital Revolutionaries
1st Floor, Castleriver House
14-= 15 Parliament Street
Temple Bar,Dublin 2
Ireland
-----------------= -----------------------------
[t]: + 353 1 4403907
[e]: <= mailto:tom@revo= lutionaries.ie>
[w]: <http://www.revolutionaries.ie/>
= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<= /div>

On 6 March 201= 7 at 10:21, <christophe.billiottet@webdna.us> wrote:
Hi Tom! I suppose you could = try something like this: first, create the table, something like this shoul= d work fine

[JSONstore table=3DtabJSONPARSE]
JSONobject
[/JSONstore]

you do not need to know the exact structure of the incoming JSON response, = WebDNA will do it for you (I have personally not tested with a table, but i= t does with a db)

Then, you can use [convertwords]:

[convertwords table=3DtabJSONPARSE]error:type and error:message[/convertwor= ds]

This should work=E2=80=A6

- chris


> On Mar 4, 2017, at 16:59, Tom Duke <tom@revolutionaries.ie> wrote:
>
> Chris,
>
> Hi - I'm using [jsonstore] and it's great to have it.=C2=A0 It= 's not a flexible as [xmlparse] though.
>
> So if I want to pull out the error message from a Stripe.com json resp= onse I have to do the following:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[table na= me=3DtabJSONPARSE&fields=3DtID,error:type,error:message][/table][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][jsonstore t= able=3DtabJSONPARSE][varSTRIPERESPONSE][/jsonstore][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][search tabl= e=3DtabJSONPARSE&netIDdatarq=3Dfind_all][founditems][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0[/!][text]error:type=3D[error:type][/text][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0[/!][text]error:message=3D[error:message][/text][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][/founditems= ][/search]
>
> Only then can I access the variable [error:message].=C2=A0 I also need= to know the exact structure of the incoming JSON response so I can set up = the table correctly.
>
> If we had similar functionality to [xmlparse] then I could do somethin= g like:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [jsonparse var= =3Djson_var1][varSTRIPERESPONSE][/jsonparse]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [jsonnode ref= =3Djson_var1&path=3Dnamed:error:message][value][/jsonnode]
>
> It would also be great to be able to traverse the JSON response, parti= cularly if we are not sure about the structure of the incoming JSON
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [jsonnodes ref= =3Djson_var1]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 [name]=3D[value]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [/jsonnodes] >
>
> - Tom
>
>
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<= br> > Digital Revolutionaries
> 1st Floor, Castleriver House
> 14-15 Parliament Street
> Temple Bar,Dublin 2
> Ireland
> ----------------------------------------------
> [t]: + 353 1 4403907
> [e]: <mailto:tom@revolutionaries.ie>
> [w]: <http://www.revolutionaries.ie/>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<= br> >
> On 3 March 2017 at 15:27, <christophe.billiottet@webdna.us> w= rote:
> Hi Tom! WebDNA already includes a JSON parser, that takes any JSON Obj= ect, parse and store it: it will automatically create the database if it do= es not exist, create the fields and populate it.
>
> http://www.webdna.us/page.dna?numero=3D307 >
> From this, it is easy to use the data by treating the database (or tab= le) like any other WebDNA database.
>
> best regards,
>
> - chris
>
>
>
> > On Mar 3, 2017, at 15:57, Tom Duke <tom@revolutionaries.ie> wrote:
> >
> > Chris,
> >
> > Hi - great to hear that you are working on this.
> >
> > The features that I would love to see are:
> >
> >
> > [json_encode]{data}[/json_encode]
> >
> > It would operate the same as the matching PHP function: http://www.php.net/manual/en/function.json-encode= ..php
> >
> > So the data would be a WebDNA array and/or perhaps name/value pai= rs separated by line returns. Nested JSON would require some thought, some = ideas here: http://stack= overflow.com/questions/15810257/create-nested-json-object-in-php<= /a>
> >
> >
> > [json_parse]{data}[/json_parse]
> >
> > It would operate in a similar way to [xmlparse] allowing us to tr= averse and extract the JSON data by node.=C2=A0 Also similar to the PHP jso= n_decode function:
http://www.php.net/manual/en= /function.json-decode.php
> >
> >
> >
> > - Tom
> >
> >
> >
> >
> >
> >
> >
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
> > Digital Revolutionaries
> > 1st Floor, Castleriver House
> > 14-15 Parliament Street
> > Temple Bar,Dublin 2
> > Ireland
> > ----------------------------------------------
> > [t]: + 353 1 4403907
> > [e]: <mailto:tom@revolutionaries.ie>
> > [w]: <http://www.revolutionaries.ie/>
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
> >
> > On 27 February 2017 at 14:24, <christophe.billiottet@webdna.us<= /a>> wrote:
> > Hello,
> >
> > we are interested to expand and develop the JSON capabilities and= compatibility of WebDNA, particularly treating JSON-formatted returns from= javascript as well as submitting JSON-formatted info to external programs = and applications.
> >
> > If you have any related ideas, we are listening! :-)
> >
> > - chris-----------------------------------------------------= ----
> > This message is sent to you because you are subscribed to
> > the mailing list <
talk@webdna.us>.
> > To unsubscribe, E-mail to: <talk-leave@webdna.us>
> > archives: http://mail.webdna.us/list/talk@we= bdna.us
> > Bug Reporting: support@webdna.us
> >
> > --------------------------------------------------------- Th= is message is sent to you because you are subscribed to the mailing list . = To unsubscribe, E-mail to: archives: http://mail.webdna.us/= list/talk@webdna.us Bug Reporting: support@webdna.us
>
> ---------------------------------------------------------
> This message is sent to you because you are subscribed to
> the mailing list <talk@webdna.us>.
> To unsubscribe, E-mail to: <talk-leave@webdna.us>
> archives: http://mail.webdna.us/list/talk@webdna.= us
> Bug Reporting: = support@webdna.us
>
> --------------------------------------------------------- This me= ssage is sent to you because you are subscribed to the mailing list . To un= subscribe, E-mail to: archives: http://mail.webdna.us/list/= talk@webdna.us Bug Reporting: support@webdna.us

---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list <ta= lk@webdna.us>.
To unsubscribe, E-mail to: <talk-leave@webdna.us>
archives: http://mail.webdna.us/list/talk@webdna.us
Bug Reporting:
suppo= rt@webdna.us


--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --001a113946dcc5ee35055ed039e5-- . Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] WebDNA Development server (William DeVaul 2018)
  2. Re: [WebDNA] WebDNA Development server (Stuart Tremain 2018)
  3. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  4. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  5. Re: [WebDNA] WebDNA development (christophe.billiottet@webdna.us 2017)
  6. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  7. Re: [WebDNA] WebDNA development (christophe.billiottet@webdna.us 2017)
  8. Re: [WebDNA] WebDNA development (Tom Duke 2017)
  9. [WebDNA] WebDNA development (christophe.billiottet@webdna.us 2017)
1338 --001a113946dcc5ee35055ed039e5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, Just to finish this off. Here's a function to pull a value from a JsonObject when you know the node name. If anyone can improve on this that would be great. - Tom [!] +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ FUNCTION Name: smGetJsonValue ** Description: Pull out a value from a JSONobject ** Input: jsonObject =3D (the json to be parsed) - required jsonNode =3D (the node that we the value of) - required ** usage: [smGetJsonValue jsonObject=3D[url][/url]&jsonNode=3D] [/!][function name=3DsmGetJsonValue][!] [/!][text]tReturn=3D[/text][!] [/!][text]tJsonObject=3D[/text][!] [/!][text]tJsonNode=3Dnull[/text][!] [/!][showif [url][params_string][/url]^jsonObject][text]tJsonObject=3D[jsonObject][/tex= t][/showif][!] [/!][showif [url][params_string][/url]^jsonNode][text]tJsonNode=3D[jsonNode][/text][/sh= owif][!] ### Store the jsonObject in a table ### [/!][jsonstore table=3DjsonOject][tJsonObject][/jsonstore][!] ### Search the table ### [/!][search table=3DjsonOject&ne[tJsonNode]data=3Dfind_all][founditems][!] [/!][text]tReturn=3D[interpret][[tJsonNode]][/interpret][/text][!] [/!][/founditems][/search][!] ### Return the value ### [/!][return][tReturn][/return][!] [/!][/function] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Digital Revolutionaries 1st Floor, Castleriver House 14-15 Parliament Street Temple Bar,Dublin 2 Ireland ---------------------------------------------- [t]: + 353 1 4403907 [e]: [w]: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D On 25 November 2017 at 14:50, Tom Duke wrote: > Chris, > > Hi - finally coming back to this. > > The [convertwords] idea does not work as each node in the table / databas= e > created by [JSONstore] is added as a field. So we don't have a 'from,to' > field structure. > > I also can't seem to use [listfields] with a table. So the only option i= f > you don't know the structure of the JSONobject is to use [JSONstore] to > create a database on disk and then use [listfields] on that to traverse t= he > JSONobject. > > Something like this is needed just to see the values from the JSONobject > > [jsonstore db=3Djsonparse.db]JSONobject[/jsonstore] > [listfields db=3Djsonparse.db] > [showif [index]=3D1] > [text]node-1-name=3D[fieldname][/text] > [/showif] > [/listfields] > [search db=3Djsonparse.db&ne[node-1-name]data=3Dfind_all][founditems] > [listfields db=3Djsonparse.db] > [fieldname]=3D[interpret][[fieldname]][/interpret] > [/listfields] > [/founditems][/search] > > The 'jsonparse.db' then has to be zero'd out after each [JSONstore], or > new data get appended to it. Alternatively we name the database somethin= g > like jsonparse-[cart].db to ensure they are unique, but we end up litteri= ng > the disk with databases. > > In the context of dealing with json from an api or ajax call it seems lik= e > a lot of overhead to traverse a json response. > > Take care > - Tom > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Digital Revolutionaries > 1st Floor, Castleriver House > 14-15 Parliament Street > Temple Bar,Dublin 2 > Ireland > ---------------------------------------------- > [t]: + 353 1 4403907 <(01)%20440%203907> > [e]: > [w]: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > On 6 March 2017 at 10:21, wrote: > >> Hi Tom! I suppose you could try something like this: first, create the >> table, something like this should work fine >> >> [JSONstore table=3DtabJSONPARSE] >> JSONobject >> [/JSONstore] >> >> you do not need to know the exact structure of the incoming JSON >> response, WebDNA will do it for you (I have personally not tested with a >> table, but it does with a db) >> >> Then, you can use [convertwords]: >> >> [convertwords table=3DtabJSONPARSE]error:type and >> error:message[/convertwords] >> >> This should work=E2=80=A6 >> >> - chris >> >> >> > On Mar 4, 2017, at 16:59, Tom Duke wrote: >> > >> > Chris, >> > >> > Hi - I'm using [JSONstore] and it's great to have it. It's not a >> flexible as [xmlparse] though. >> > >> > So if I want to pull out the error message from a Stripe.com json >> response I have to do the following: >> > >> > [table name=3DtabJSONPARSE&fields=3DtID,e >> rror:type,error:message][/table][!] >> > [/!][jsonstore table=3DtabJSONPARSE][varSTRIPER >> ESPONSE][/jsonstore][!] >> > [/!][search table=3DtabJSONPARSE&netIDdatarq >> =3Dfind_all][founditems][!] >> > [/!][text]error:type=3D[error:type][/text][!] >> > [/!][text]error:message=3D[error:message][/text]= [!] >> > [/!][/founditems][/search] >> > >> > Only then can I access the variable [error:message]. I also need to >> know the exact structure of the incoming JSON response so I can set up t= he >> table correctly. >> > >> > If we had similar functionality to [xmlparse] then I could do somethin= g >> like: >> > >> > [jsonparse var=3Djson_var1][varSTRIPERESPONSE][/jsonpar= se] >> > [jsonnode ref=3Djson_var1&path=3Dnamed:error >> :message][value][/jsonnode] >> > >> > It would also be great to be able to traverse the JSON response, >> particularly if we are not sure about the structure of the incoming JSON >> > >> > [jsonnodes ref=3Djson_var1] >> > [name]=3D[value] >> > [/jsonnodes] >> > >> > >> > - Tom >> > >> > >> > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > Digital Revolutionaries >> > 1st Floor, Castleriver House >> > 14-15 Parliament Street >> > Temple Bar,Dublin 2 >> > Ireland >> > ---------------------------------------------- >> > [t]: + 353 1 4403907 >> > [e]: >> > [w]: >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > >> > On 3 March 2017 at 15:27, wrote: >> > Hi Tom! WebDNA already includes a JSON parser, that takes any JSON >> Object, parse and store it: it will automatically create the database if= it >> does not exist, create the fields and populate it. >> > >> > http://www.webdna.us/page.dna?numero=3D307 >> > >> > From this, it is easy to use the data by treating the database (or >> table) like any other WebDNA database. >> > >> > best regards, >> > >> > - chris >> > >> > >> > >> > > On Mar 3, 2017, at 15:57, Tom Duke wrote: >> > > >> > > Chris, >> > > >> > > Hi - great to hear that you are working on this. >> > > >> > > The features that I would love to see are: >> > > >> > > >> > > [json_encode]{data}[/json_encode] >> > > >> > > It would operate the same as the matching PHP function: >> http://www.php.net/manual/en/function.json-encode.php >> > > >> > > So the data would be a WebDNA array and/or perhaps name/value pairs >> separated by line returns. Nested JSON would require some thought, some >> ideas here: http://stackoverflow.com/questions/15810257/create-nested- >> json-object-in-php >> > > >> > > >> > > [json_parse]{data}[/json_parse] >> > > >> > > It would operate in a similar way to [xmlparse] allowing us to >> traverse and extract the JSON data by node. Also similar to the PHP >> json_decode function: http://www.php.net/manual/en/f >> unction.json-decode.php >> > > >> > > >> > > >> > > - Tom >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > > Digital Revolutionaries >> > > 1st Floor, Castleriver House >> > > 14-15 Parliament Street >> > > Temple Bar,Dublin 2 >> > > Ireland >> > > ---------------------------------------------- >> > > [t]: + 353 1 4403907 >> > > [e]: >> > > [w]: >> > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > > >> > > On 27 February 2017 at 14:24, >> wrote: >> > > Hello, >> > > >> > > we are interested to expand and develop the JSON capabilities and >> compatibility of WebDNA, particularly treating JSON-formatted returns fr= om >> javascript as well as submitting JSON-formatted info to external program= s >> and applications. >> > > >> > > If you have any related ideas, we are listening! :-) >> > > >> > > - chris--------------------------------------------------------- >> > > This message is sent to you because you are subscribed to >> > > the mailing list . >> > > To unsubscribe, E-mail to: >> > > archives: http://mail.webdna.us/list/talk@webdna.us >> > > Bug Reporting: support@webdna.us >> > > >> > > --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list . = To >> unsubscribe, E-mail to: archives: http://mail.webdna.us/list/tal >> k@webdna.us Bug Reporting: support@webdna.us >> > >> > --------------------------------------------------------- >> > This message is sent to you because you are subscribed to >> > the mailing list . >> > To unsubscribe, E-mail to: >> > archives: http://mail.webdna.us/list/talk@webdna.us >> > Bug Reporting: support@webdna.us >> > >> > --------------------------------------------------------- This message >> is sent to you because you are subscribed to the mailing list . To >> unsubscribe, E-mail to: archives: http://mail.webdna.us/list/tal >> k@webdna.us Bug Reporting: support@webdna.us >> >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> > > --001a113946dcc5ee35055ed039e5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

Just to finish this off.=C2=A0 = Here's a function to pull a value from a JsonObject when you know the n= ode name.

If anyone can improve on this that would= be great.

- Tom






=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FUNCTION Name: smGetJsonValue
=C2=A0 ** Description: Pull o= ut a value from a JSONobject
=C2=A0 ** Input:=C2=A0
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 jsonObject =3D (the json to be parsed) - required<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 jsonNode =3D (the node that we the va= lue of) - required
=C2=A0 ** usage:=C2=A0
=C2=A0 =C2=A0= =C2=A0 =C2=A0 [smGetJsonValue jsonObject=3D[url]<the-json-object>[/u= rl]&jsonNode=3D<the-json-node>]

[/!][fun= ction name=3DsmGetJsonValue][!]
[/!][text]tReturn=3D[/text][!]

[/!][text]tJsonObject=3D[/text][!]
[/!][text]tJson= Node=3Dnull[/text][!]

[/!][showif [url][params_string]= [/url]^jsonObject][text]tJsonObject=3D[jsonObject][/text][/showif][!]
=
[/!][showif [url][params_string][/url]^jsonNode][text]tJsonNode=3D[jsonNod= e][/text][/showif][!]

### =C2=A0Store the jsonObject i= n a table =C2=A0###

[/!][jsonstore table=3DjsonOje= ct][tJsonObject][/jsonstore][!]

### =C2=A0Search the t= able =C2=A0###

[/!][search table=3DjsonOject&n= e[tJsonNode]data=3Dfind_all][founditems][!]

[/!][text]= tReturn=3D[interpret][[tJsonNode]][/interpret][/text][!]

[/!][/founditems][/search][!]

### =C2=A0Retur= n the value =C2=A0###

[/!][return][tReturn][/retur= n][!]
[/!][/function]






=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D
Digital Revolutionaries
1st Floor, Castleriver = House
14-15 Parliament Street
Temple Bar,Dublin 2
Ireland
-----= -----------------------------------------
[t]: + 353 1 4403907
[e]: &= lt;mailto:tom@r= evolutionaries.ie>
[w]: <http://www.revolutionaries.ie/>
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

On 25 November 2017 at 14:50, Tom Duke <tom@revolutionaries.ie> wrote:
Chris,

Hi - finally coming back t= o this.

The [convertwords] idea does not work as e= ach node in the table / database created by [JSONstore] is added as a field= ..=C2=A0 So we don't have a 'from,to' field structure.

I also can't seem to use [listfields] with a table.=C2= =A0 So the only option if you don't know the structure of the JSONobjec= t is to use [JSONstore] to create a database on disk and then use [listfiel= ds] on that to traverse the JSONobject.

Something = like this is needed just to see the values from the JSONobject
[jsonstore db=3Djsonparse.db]JSONobject[/jsonstore]
=
[listfields db=3Djsonparse.db]
=C2=A0 =C2=A0 [showif [index]= =3D1]
=C2=A0 =C2=A0 =C2=A0 [text]node-1-name=3D[fieldname][/= text]
=C2=A0 =C2=A0 [/showif]
[/listfields]
[= search db=3Djsonparse.db&ne[node-1-name]data=3Dfind_all][foun= ditems]
[listfields db=3Djsonparse.db]
=C2=A0 =C2= =A0 [fieldname]=3D[interpret][[fieldname]][/interpret]
[/lis= tfields]
[/founditems][/search]

Th= e 'jsonparse.db' then has to be zero'd out after each [jsonstor= e], or new data get appended to it.=C2=A0 Alternatively we name the databas= e something like jsonparse-[cart].db to ensure they are unique, but we end = up littering the disk with databases.

In the conte= xt of dealing with json from an api or ajax call it seems like a lot of ove= rhead to traverse a json response.

Take care
=
- Tom




=

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
Digital Revolutionaries
1st Floor, Castleriver House
14-= 15 Parliament Street
Temple Bar,Dublin 2
Ireland
-----------------= -----------------------------
[t]: + 353 1 4403907
[e]: <= mailto:tom@revo= lutionaries.ie>
[w]: <http://www.revolutionaries.ie/>
= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<= /div>

On 6 March 201= 7 at 10:21, <christophe.billiottet@webdna.us> wrote:
Hi Tom! I suppose you could = try something like this: first, create the table, something like this shoul= d work fine

[JSONstore table=3DtabJSONPARSE]
JSONobject
[/JSONstore]

you do not need to know the exact structure of the incoming JSON response, = WebDNA will do it for you (I have personally not tested with a table, but i= t does with a db)

Then, you can use [convertwords]:

[convertwords table=3DtabJSONPARSE]error:type and error:message[/convertwor= ds]

This should work=E2=80=A6

- chris


> On Mar 4, 2017, at 16:59, Tom Duke <tom@revolutionaries.ie> wrote:
>
> Chris,
>
> Hi - I'm using [JSONstore] and it's great to have it.=C2=A0 It= 's not a flexible as [xmlparse] though.
>
> So if I want to pull out the error message from a Stripe.com json resp= onse I have to do the following:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[table na= me=3DtabJSONPARSE&fields=3DtID,error:type,error:message][/table][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][jsonstore t= able=3DtabJSONPARSE][varSTRIPERESPONSE][/jsonstore][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][search tabl= e=3DtabJSONPARSE&netIDdatarq=3Dfind_all][founditems][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0[/!][text]error:type=3D[error:type][/text][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0[/!][text]error:message=3D[error:message][/text][!]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[/!][/founditems= ][/search]
>
> Only then can I access the variable [error:message].=C2=A0 I also need= to know the exact structure of the incoming JSON response so I can set up = the table correctly.
>
> If we had similar functionality to [xmlparse] then I could do somethin= g like:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [jsonparse var= =3Djson_var1][varSTRIPERESPONSE][/jsonparse]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [jsonnode ref= =3Djson_var1&path=3Dnamed:error:message][value][/jsonnode]
>
> It would also be great to be able to traverse the JSON response, parti= cularly if we are not sure about the structure of the incoming JSON
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [jsonnodes ref= =3Djson_var1]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 [name]=3D[value]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 [/jsonnodes] >
>
> - Tom
>
>
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<= br> > Digital Revolutionaries
> 1st Floor, Castleriver House
> 14-15 Parliament Street
> Temple Bar,Dublin 2
> Ireland
> ----------------------------------------------
> [t]: + 353 1 4403907
> [e]: <mailto:tom@revolutionaries.ie>
> [w]: <http://www.revolutionaries.ie/>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<= br> >
> On 3 March 2017 at 15:27, <christophe.billiottet@webdna.us> w= rote:
> Hi Tom! WebDNA already includes a JSON parser, that takes any JSON Obj= ect, parse and store it: it will automatically create the database if it do= es not exist, create the fields and populate it.
>
> http://www.webdna.us/page.dna?numero=3D307 >
> From this, it is easy to use the data by treating the database (or tab= le) like any other WebDNA database.
>
> best regards,
>
> - chris
>
>
>
> > On Mar 3, 2017, at 15:57, Tom Duke <tom@revolutionaries.ie> wrote:
> >
> > Chris,
> >
> > Hi - great to hear that you are working on this.
> >
> > The features that I would love to see are:
> >
> >
> > [json_encode]{data}[/json_encode]
> >
> > It would operate the same as the matching PHP function: http://www.php.net/manual/en/function.json-encode= ..php
> >
> > So the data would be a WebDNA array and/or perhaps name/value pai= rs separated by line returns. Nested JSON would require some thought, some = ideas here: http://stack= overflow.com/questions/15810257/create-nested-json-object-in-php<= /a>
> >
> >
> > [json_parse]{data}[/json_parse]
> >
> > It would operate in a similar way to
[xmlparse] allowing us to tr= averse and extract the JSON data by node.=C2=A0 Also similar to the PHP jso= n_decode function: http://www.php.net/manual/en= /function.json-decode.php
> >
> >
> >
> > - Tom
> >
> >
> >
> >
> >
> >
> >
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
> > Digital Revolutionaries
> > 1st Floor, Castleriver House
> > 14-15 Parliament Street
> > Temple Bar,Dublin 2
> > Ireland
> > ----------------------------------------------
> > [t]: + 353 1 4403907
> > [e]: <mailto:tom@revolutionaries.ie>
> > [w]: <http://www.revolutionaries.ie/>
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
> >
> > On 27 February 2017 at 14:24, <christophe.billiottet@webdna.us<= /a>> wrote:
> > Hello,
> >
> > we are interested to expand and develop the JSON capabilities and= compatibility of WebDNA, particularly treating JSON-formatted returns from= javascript as well as submitting JSON-formatted info to external programs = and applications.
> >
> > If you have any related ideas, we are listening! :-)
> >
> > - chris-----------------------------------------------------= ----
> > This message is sent to you because you are subscribed to
> > the mailing list <
talk@webdna.us>.
> > To unsubscribe, E-mail to: <talk-leave@webdna.us>
> > archives: http://mail.webdna.us/list/talk@we= bdna.us
> > Bug Reporting: support@webdna.us
> >
> > --------------------------------------------------------- Th= is message is sent to you because you are subscribed to the mailing list . = To unsubscribe, E-mail to: archives: http://mail.webdna.us/= list/talk@webdna.us Bug Reporting: support@webdna.us
>
> ---------------------------------------------------------
> This message is sent to you because you are subscribed to
> the mailing list <talk@webdna.us>.
> To unsubscribe, E-mail to: <talk-leave@webdna.us>
> archives: http://mail.webdna.us/list/talk@webdna.= us
> Bug Reporting: = support@webdna.us
>
> --------------------------------------------------------- This me= ssage is sent to you because you are subscribed to the mailing list . To un= subscribe, E-mail to: archives: http://mail.webdna.us/list/= talk@webdna.us Bug Reporting: support@webdna.us

---------------------------------------------------------
This message is sent to you because you are subscribed to
the mailing list <ta= lk@webdna.us>.
To unsubscribe, E-mail to: <talk-leave@webdna.us>
archives: http://mail.webdna.us/list/talk@webdna.us
Bug Reporting:
suppo= rt@webdna.us


--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list talk@webdna.us To unsubscribe, E-mail to: talk-leave@webdna.us archives: http://www.webdna.us/page.dna?numero=3D55 Bug Reporting: support@webdna.us --001a113946dcc5ee35055ed039e5-- . Tom Duke

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebCat templates for TyphoonPro admin (1999) Re2: frames & carts (1997) Generating unique SKU from [cart] (1997) OT: SSL Certs (2005) WebCat b13 CGI -shownext- (1997) BBEdit and WebCatalog 2.0? (1997) 2.1b3 --> way slow (1997) Problems with [Applescript] (1997) WebCatalog on Linux (2000) Date Comparison (1998) Quickie question on the email templates (1997) Showif probably dumb question (1997) Error handling for accountNum (1997) Setting up WebCatalog with Retail Pro data (1996) No answers by SM? (2000) Fw: Linux w/ apache (2000) Emailer problem (1998) Protecting Realms (1998) carriage returns in data (1997) Country & Ship-to address & other fields ? (1997)