New plugin: Json Parser

Discuss questions about plugin development with the Hollywood SDK here
User avatar
midwan
Posts: 74
Joined: Sun Jun 19, 2016 1:15 pm
Location: Sweden

New plugin: Json Parser

Post by midwan »

I was thinking about developing a new Plugin for Hollywood, to handle Json strings/files.
I haven't done that before for Hollywood, but I do have experience with C/C++ and other languages.

I've got the SDK, and I saw that there's already an XMLParser plugin, but unfortunately the sources for that are not available.

Would it be possible to share those, as I think it might be quite similar in concept to what I have in mind?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: New plugin: Json Parser

Post by airsoftsoftwair »

I can send you the XML parser plugin source code if you want. Please send me an email.
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: New plugin: Json Parser

Post by SamuraiCrow »

I'm pretty sure that Allanon has written a JSON parser for the patrons of his Patreon account and it's pure Hollywood so no need for plugins.
I'm on registered MorphOS using FlowStudio.
User avatar
midwan
Posts: 74
Joined: Sun Jun 19, 2016 1:15 pm
Location: Sweden

Re: New plugin: Json Parser

Post by midwan »

Thanks for both the replies!

My e-mail is midwan at gmail dot com, if you could send me the sources for the XML Parser. Even if there's already something out there, it would help me understand how one would go about writing something similar anyway.

@SamuraiCrow: Is there a link to Allanon's work somewhere? Is it available for all, or only for the patrons?
User avatar
Clyde
Posts: 348
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

Re: New plugin: Json Parser

Post by Clyde »

@midwan: Thumbs up for learning and understanding! Here are Allanon's libaries: http://www.a-mc.biz/_software/hollywood-libraries/ But it seems no JSON lib here. If yo go to his documentation site (http://a-mc.biz/docsite/doku.php) at least "JSON" is listed.

I can't find something JSON releated on his Patreon site (I am a Patreon and so should you :-D ), though.
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: New plugin: Json Parser

Post by SamuraiCrow »

I appear to have opened a can of worms. I am a translator for Allanon's documentation. As such, I seem to have access to some unreleased software libraries. It's up to Allanon to release and write the original Italian documentation for me to translate and tidy up in English.
I'm on registered MorphOS using FlowStudio.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: New plugin: Json Parser

Post by airsoftsoftwair »

@midwan: I have just sent the xmlparser sources to you. It is based on LuaExpat. The easiest way to create a JSON plugin for Hollywood is probably to take an existing Lua JSON plugin and adapt it to Hollywood's plugin interface. You have to be careful with some Lua internals, though, because Hollywood still uses Lua 5.0 and most Lua plugins target later versions like 5.2 or 5.3.
User avatar
midwan
Posts: 74
Joined: Sun Jun 19, 2016 1:15 pm
Location: Sweden

Re: New plugin: Json Parser

Post by midwan »

Understood, thanks for sending me the sources and the useful input :)
I'll post any news here when I have them!
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: New plugin: Json Parser

Post by airsoftsoftwair »

Would be nice if you could finish that job. A JSON plugin is on my agenda as well but if you do it, then that's even better, because it leaves more resources for me for the really important stuff :)
User avatar
Allanon
Posts: 732
Joined: Sun Feb 14, 2010 7:53 pm
Location: Italy
Contact:

Re: New plugin: Json Parser

Post by Allanon »

Hi guys,
I've noticed only now this thread! Sorry! :D

Yes, I've a written JSON parser to decode server answers for a project but I've not published it yet because the code is dirty, no comments at all, but it works fine.
If someone is interested I can publish it as is, it returns an Hollywood table but there is no encoding methods, just decode.
Post Reply