File:  [mozdev] / annozilla / scripts / list_annotations.pl
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Fri Dec 20 12:05:03 2002 UTC (14 years, 11 months ago) by matthew
Branches: MAIN
CVS tags: HEAD, ANNOZILLA-ES-CHANGES, ANNOZILLA-ES, ANNOZILLA-CGH-CHANGES, ANNOZILLA-0-7-0, ANNOZILLA-0-6-7-BRANCH, ANNOZILLA-0-6-7
Script to list annotations for a page

use Data::Dumper;
use HTTP::Headers;
use HTTP::Request;
use LWP::UserAgent;
use Term::ReadKey;

my $server = 'http://annotest.w3.org/annotations';
my $user   = undef; # '<enter user name here>';
my $url    = undef; # '<enter URL of page to get annotations for here>';

die "No user defined\n" unless defined $user;
die "No url defined\n"  unless defined $url;

print "Enter annotation password:\n";
ReadMode 2;
my $password = ReadLine(0);
ReadMode 0;
chomp $password;

my $ua = new LWP::UserAgent;
my $h = new HTTP::Headers;

$h->header (host => 'annotest.w3.org');
$h->header (Accept => 'text/rdf');
$h->authorization_basic ($user, $password);
my $req = HTTP::Request->new ('GET', "$server?w3c_annotates=$url&w3c_forceText=*", $h);

my $res = $ua->request($req);
print Dumper $res;

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