More JSON handling routines in LMS builds?

Paul Webster <Paul.Webster.aer48n-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]>
Newsgroups gmane.music.equipment.slimdevices.devel
Organization Logitech Squeezebox Forums
Message-ID <[email protected]>
Philippe's recent post about Crypto reminded me of this.

I'd like something that would allow me to specify json in a similar way
to how XPath does for XML.
I think this would allow me to remove code I have that checks for
certain elements being present in a received JSON document and instead
move it out to a configuration file that checks an XPath-like
definition.

In my messy code I have a bunch of if/then/else statements testing the
received json from various radio stations to determine which format it
is in so that I can subsequently parse it correctly.
I have made the subsequent parsing code simpler than it used to be by
having song & programme field names in a config file per station group.

I could put real Perl code in the config files and then eval it but I
don't think that is a good way of doing things.

If I could put a XPath like statement in there as well then I could
simplify things further.

Perhaps JSON::Path ... it looks to me like it has a lot of dependencies
that are currently not met in standard LMS installation and I think some
are not pure Perl so would mean compiling and packaging binaries for the
various platforms which is something I don't really want to get into.



Paul Webster
author of \"now playing\" plugins covering radio france (fip etc),
planetradio (bauer - kiss, absolute, scala, jazzfm etc), kcrw, abc
australia and cbc/radio-canada
and, via the extra \"radio now playing\" plugin lots more - see
https://forums.slimdevices.com/showthread.php?115201-announce-radio-now-playing-plugin
------------------------------------------------------------------------
Paul Webster's Profile: http://forums.slimdevices.com/member.php?userid=105
View this thread: http://forums.slimdevices.com/showthread.php?t=115821
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.