/[socialtext-import]/tamtam/tamtam2socialtext.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /tamtam/tamtam2socialtext.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by dpavlin, Thu Dec 13 11:42:24 2007 UTC revision 23 by dpavlin, Thu Dec 13 11:46:46 2007 UTC
# Line 17  use Data::Dump qw/dump/; Line 17  use Data::Dump qw/dump/;
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;
# Line 209  foreach my $name ( keys %$page ) { Line 211  foreach my $name ( keys %$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  }  }

Legend:
Removed from v.22  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26