Annotation of annozilla/scripts/list_annotations.pl, revision 1.1

1.1     ! matthew     1: use Data::Dumper;
        !             2: use HTTP::Headers;
        !             3: use HTTP::Request;
        !             4: use LWP::UserAgent;
        !             5: use Term::ReadKey;
        !             6: 
        !             7: my $server = 'http://annotest.w3.org/annotations';
        !             8: my $user   = undef; # '<enter user name here>';
        !             9: my $url    = undef; # '<enter URL of page to get annotations for here>';
        !            10: 
        !            11: die "No user defined\n" unless defined $user;
        !            12: die "No url defined\n"  unless defined $url;
        !            13: 
        !            14: print "Enter annotation password:\n";
        !            15: ReadMode 2;
        !            16: my $password = ReadLine(0);
        !            17: ReadMode 0;
        !            18: chomp $password;
        !            19: 
        !            20: my $ua = new LWP::UserAgent;
        !            21: my $h = new HTTP::Headers;
        !            22: 
        !            23: $h->header (host => 'annotest.w3.org');
        !            24: $h->header (Accept => 'text/rdf');
        !            25: $h->authorization_basic ($user, $password);
        !            26: my $req = HTTP::Request->new ('GET', "$server?w3c_annotates=$url&w3c_forceText=*", $h);
        !            27: 
        !            28: my $res = $ua->request($req);
        !            29: print Dumper $res;

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