17 |
|
|
18 |
my $debug = 0; |
my $debug = 0; |
19 |
my $max = 999; |
my $max = 999; |
20 |
|
my $attachments = 0; |
21 |
|
|
22 |
GetOptions( |
GetOptions( |
23 |
'debug+' => \$debug, |
'debug+' => \$debug, |
24 |
'max=i' => \$max, |
'max=i' => \$max, |
25 |
|
'attachments' => \$attachments, |
26 |
); |
); |
27 |
|
|
28 |
my $page; |
my $page; |
211 |
$Rester->put_pagetag( $name, $_ ); |
$Rester->put_pagetag( $name, $_ ); |
212 |
print "+ tag $_\n"; |
print "+ tag $_\n"; |
213 |
} |
} |
214 |
foreach my $a ( @{ $p->{attachments} } ) { |
|
215 |
my $type = $m->get_mime( $a->{full_path} ); |
if ( $attachments ) { |
216 |
my $content = read_file( $a->{full_path} ); |
foreach my $a ( @{ $p->{attachments} } ) { |
217 |
print "+ attachment ", $a->{name}," $type ", length($content), " bytes\n"; |
my $type = $m->get_mime( $a->{full_path} ); |
218 |
$Rester->post_attachment($name, $a->{name}, $content, $type ); |
my $content = read_file( $a->{full_path} ); |
219 |
|
print "+ attachment ", $a->{name}," $type ", length($content), " bytes\n"; |
220 |
|
$Rester->post_attachment($name, $a->{name}, $content, $type ); |
221 |
|
} |
222 |
} |
} |
223 |
|
|
224 |
} |
} |