/[Grep]/bin/import.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

Annotation of /bin/import.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 158 - (hide annotations)
Sun Jun 10 20:16:30 2007 UTC (14 years, 4 months ago) by dpavlin
File MIME type: text/plain
File size: 953 byte(s)
fixed requirements, cleanup API, resolve links in imported content
1 dpavlin 154 #!/usr/bin/perl
2    
3     # helper script to import external data sources into local index and full text index
4    
5     use strict;
6    
7     use lib 'lib';
8    
9     use Jifty;
10     use Grep::Search;
11     use Module::Pluggable search_path => 'Grep::Import', sub_name => 'importers', require => 1;
12     use Data::Dump qw/dump/;
13    
14     $|=1;
15    
16     BEGIN { Jifty->new; };
17    
18     my @importers = __PACKAGE__->importers();
19    
20     Jifty->log->debug("Found import plugins: ", join(", ", @importers) );
21    
22     foreach my $importer ( @importers ) {
23    
24     if ( $importer->can('import') ) {
25     Jifty->log->info("importing with $importer");
26 dpavlin 155
27 dpavlin 158 my $stats = $importer->import();
28 dpavlin 155
29 dpavlin 157 Jifty->log->info( join(" ",
30     ( $stats->{new} ? $stats->{new} . ' new' : '' ),
31     ( $stats->{old} ? $stats->{old} . ' old' : '' ) . ' pages',
32     ( $stats->{failure} ? 'with ' . $stats->{failure} . ' failures' : '' ),
33     'of total ' . $stats->{total} . ' using ' . $importer,
34     ) );
35 dpavlin 154 } else {
36     Jifty->log->error("importer $importer doesn't implement import");
37     }
38     }
39    
40    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26