Parent Directory | Revision Log | Patch
revision 133 by dpavlin, Mon May 8 21:34:00 2006 UTC | revision 141 by dpavlin, Wed May 10 14:52:28 2006 UTC | |
---|---|---|
# | Line 1 | Line 1 |
1 | #!/usr/bin/perl -w | #!/usr/bin/perl -w |
2 | ||
3 | use strict; | use strict; |
4 | use Search::Estraier; | use Search::Estraier 0.06; |
5 | use URI::Escape qw/uri_escape/; | use URI::Escape qw/uri_escape/; |
6 | use Time::HiRes; | use Time::HiRes; |
7 | use POSIX qw/strftime/; | use POSIX qw/strftime/; |
# | Line 33 my $to_n = new Search::Estraier::Node( | Line 33 my $to_n = new Search::Estraier::Node( |
33 | debug => $debug, | debug => $debug, |
34 | user => 'admin', | user => 'admin', |
35 | passwd => 'admin', | passwd => 'admin', |
36 | create => 1, | |
37 | label => $from_n->label, | |
38 | ); | ); |
39 | ||
unless(eval{ $to_n->name }) { | ||
if ($to =~ m#^(http://.+)/node/([^/]+)$#) { | ||
my ($url,$name) = ($1,$2); | ||
print "Creating '$name' on $url\n"; | ||
$to_n->shuttle_url( $url . '/master?action=nodeadd', | ||
'application/x-www-form-urlencoded', | ||
'name=' . uri_escape($name) . '&label=' . uri_escape( $name ), | ||
undef, | ||
); | ||
} else { | ||
die "can't extract node name from $to\n"; | ||
} | ||
} | ||
40 | print "Copy from ",$from_n->name," (",$from_n->label,") to ",$to_n->name," (",$to_n->label,") - ",$from_n->doc_num," documents (",$from_n->word_num," words, ",$from_n->size," bytes)\n"; | print "Copy from ",$from_n->name," (",$from_n->label,") to ",$to_n->name," (",$to_n->label,") - ",$from_n->doc_num," documents (",$from_n->word_num," words, ",$from_n->size," bytes)\n"; |
41 | ||
42 | my $doc_num = $from_n->doc_num || 1; | my $doc_num = $from_n->doc_num || 1; |
|
ViewVC Help | |
Powered by ViewVC 1.1.26 |