[BACK]Return to update_json.pl CVS log [TXT][DIR] Up to [local] / HOPE / Net-OpenAMD / script

Annotation of HOPE/Net-OpenAMD/script/update_json.pl, Revision 1.1

1.1     ! andrew      1: #!/usr/bin/perl
        !             2: use strict;
        !             3: use warnings;
        !             4:
        !             5: use LWP::Simple;
        !             6:
        !             7: my $uri_base  = 'http://api.hope.net/api/';
        !             8: my $file_base = './t/data/';
        !             9:
        !            10: my @paths = (
        !            11:     'interests', 'location', 'speakers', 'stats',
        !            12:     'talks', 'users', 'location?user=user0',
        !            13: );
        !            14:
        !            15:
        !            16: foreach my $path (@paths) {
        !            17:     my $uri  = $uri_base  . $path;
        !            18:
        !            19:     $path =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
        !            20:     my $file = $file_base . $path;
        !            21:
        !            22:     print "mirror( $uri, $file )\n";
        !            23:
        !            24:     my $response = mirror( $uri, $file );
        !            25:     if (!is_success( $response )) {
        !            26:         print "\tError: $response\n";
        !            27:     }
        !            28: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>