JSON API use in Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JSON API use in Pharo

Dennis Schenk
Hi all,

I'd like to read and parse JSON from a URL or alternatively from files. Could anyone point me in the right direction to achieve this? Is a JSON Parser available in Pharo or is there a project which provides this functionality?

Cheers,
Dennis

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: JSON API use in Pharo

Dennis Schenk
Found PetitJson:



On Tue, Oct 16, 2012 at 11:57 AM, Dennis Schenk <[hidden email]> wrote:
Hi all,

I'd like to read and parse JSON from a URL or alternatively from files. Could anyone point me in the right direction to achieve this? Is a JSON Parser available in Pharo or is there a project which provides this functionality?

Cheers,
Dennis


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: JSON API use in Pharo

Dennis Schenk
For anyone searching for something similar in the mailing list, here is how to parse JSON from a URL:

| parser jsonObject json |
parser := PPParserResource current parserAt: PPJsonParser.
json := (Url absoluteFromText: 'http://api.stackexchange.com/2.1/info?site=stackoverflow') retrieveContents contents.
jsonObject := parser parse: json.
jsonObject explore.

Cheers,
Dennis

On Tue, Oct 16, 2012 at 12:41 PM, Dennis Schenk <[hidden email]> wrote:
Found PetitJson:



On Tue, Oct 16, 2012 at 11:57 AM, Dennis Schenk <[hidden email]> wrote:
Hi all,

I'd like to read and parse JSON from a URL or alternatively from files. Could anyone point me in the right direction to achieve this? Is a JSON Parser available in Pharo or is there a project which provides this functionality?

Cheers,
Dennis



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: JSON API use in Pharo

Tudor Girba-2
Thanks Dennis.

Doru


On 16 Oct 2012, at 13:11, Dennis Schenk <[hidden email]> wrote:

> For anyone searching for something similar in the mailing list, here is how to parse JSON from a URL:
>
> | parser jsonObject json |
> parser := PPParserResource current parserAt: PPJsonParser.
> json := (Url absoluteFromText: 'http://api.stackexchange.com/2.1/info?site=stackoverflow') retrieveContents contents.
> jsonObject := parser parse: json.
> jsonObject explore.
>
> Cheers,
> Dennis
>
> On Tue, Oct 16, 2012 at 12:41 PM, Dennis Schenk <[hidden email]> wrote:
> Found PetitJson:
>
> http://source.lukas-renggli.ch/petit.html
>
>
> On Tue, Oct 16, 2012 at 11:57 AM, Dennis Schenk <[hidden email]> wrote:
> Hi all,
>
> I'd like to read and parse JSON from a URL or alternatively from files. Could anyone point me in the right direction to achieve this? Is a JSON Parser available in Pharo or is there a project which provides this functionality?
>
> Cheers,
> Dennis
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"The coherence of a trip is given by the clearness of the goal."





_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev