/[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

Contents of /bin/import.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 158 - (show annotations)
Sun Jun 10 20:16:30 2007 UTC (17 years, 1 month ago) by dpavlin
File MIME type: text/plain
File size: 953 byte(s)
fixed requirements, cleanup API, resolve links in imported content
1 #!/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
27 my $stats = $importer->import();
28
29 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 } 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