check_release.pl 659 B

123456789101112131415161718192021
  1. #!/usr/bin/env perl
  2. use LWP::Simple; # From CPAN
  3. use JSON qw( decode_json ); # From CPAN
  4. use Data::Dumper; # Perl core module
  5. use strict; # Good practice
  6. use warnings; # Good practice
  7. my $versionsurl = "http://moodle.ngtech.co.il/squid/squid-version-api/versions.cgi";
  8. my $json = get( $versionsurl );
  9. die "Could not get $versionsurl!" unless defined $json;
  10. # Decode the entire JSON
  11. my $decoded_json = decode_json( $json );
  12. # you'll get this (it'll print out); comment this when done.
  13. #print Dumper $decoded_json;
  14. # Access the shares like this:
  15. print $decoded_json->{$ARGV[0]},"\n";