/[Grep]/lib/Grep/Import/ScrapBook.pm
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 /lib/Grep/Import/ScrapBook.pm

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

revision 157 by dpavlin, Sun Jun 10 19:56:21 2007 UTC revision 158 by dpavlin, Sun Jun 10 20:16:30 2007 UTC
# Line 21  or modify L<ScrapBookDir> path (relative Line 21  or modify L<ScrapBookDir> path (relative
21    
22  use XML::Simple;  use XML::Simple;
23  use File::Slurp;  use File::Slurp;
24    use HTML::ResolveLink;
25    
26  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
27    
28  sub import {  sub import {
29          my $self = shift;          my $self = shift;
         my $search = shift or die "need search";  
         die "search is ", ref($search), " and not Grep::Search" unless ($search->isa('Grep::Search'));  
30    
31          my $dir =          my $dir =
32                  Jifty::Util->app_root . '/' .                  Jifty::Util->app_root . '/' .
# Line 62  sub import { Line 62  sub import {
62                  owner => $owner,                  owner => $owner,
63          );          );
64    
65            my $search = Grep::Search->new;
66    
67          my $stats;          my $stats;
68    
69          foreach my $item ( @{ $rdf->{'RDF:Description'} } ) {          foreach my $item ( @{ $rdf->{'RDF:Description'} } ) {
# Line 93  sub import { Line 95  sub import {
95                  my $content = read_file( $content_path ) or                  my $content = read_file( $content_path ) or
96                          die "can't read $content_path: $!";                          die "can't read $content_path: $!";
97    
98                    my $resolver = HTML::ResolveLink->new( base => $content_path );
99                    $content = $resolver->resolve( $content );
100    
101                  # create date from id                  # create date from id
102    
# Line 136  sub import { Line 140  sub import {
140    
141          }          }
142    
143            $search->finish;
144    
145          return $stats;          return $stats;
146  }  }
147    

Legend:
Removed from v.157  
changed lines
  Added in v.158

  ViewVC Help
Powered by ViewVC 1.1.26