Closed mneumark closed 8 years ago
Rather that making people install jq, what about just using perl? It's already installed in the PMS jail and has JSON support built-in.
curl 'https://plex.tv/api/downloads/1.json?channel=plexpass' | perl -MJSON::PP -E 'say decode_json(<STDIN>)->{computer}{FreeBSD}{releases}[0]{url}'
I can give that a try. Sure. Didn't remember that Perl had JSON support without resorting to CPAN.
@assistcontrol Took your advice, I will say that certainly simplifies things. Good call.
Haven't tested personally yet but it looks good. Will test it myself soon.
I switched from using a regular expression for a webpage to using the
jq
utility that parses JSON since Plex now offers a JSON API.I also put in a check to make sure the user has
jq
installed and a message explaining how to install if it is not there.