/[mws]/trunk/search.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 /trunk/search.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 47 - (hide annotations)
Tue May 11 22:59:27 2004 UTC (20 years ago) by dpavlin
File MIME type: text/plain
File size: 913 byte(s)
Major code update: 0.9-rc3 if no serious problems are found, this will
become first public version (0.9).

- search.pl is working again
- fixed Mail::Box problem with unimplemented lock_type => 'none' on Maildir
- documented Mozilla 1.5 problem with sidebar float: right
- don't output anything from swish-e while indexing
- remove (e-mail) from addresses (it seems that Exchange like to add those)
- added progress report while indexing
- documented all command-line utilities

1 dpavlin 1 #!/usr/bin/perl -w
2    
3 dpavlin 47 BEGIN {
4     my $basedir = readlink($0) || $0; $basedir =~ s#/[^/]+$##;
5     unshift(@INC, $basedir);
6     }
7    
8     =head1 NAME
9    
10     search.pl - command-line search utility
11    
12     =head1 SYNOPSYS
13    
14     search.pl [local.conf] 'subject:nice demo'
15    
16     =head1 DESCRIPTION
17    
18     This utility is useful mainly for debugging, but you can try quick-searches
19     using it.
20    
21     =cut
22    
23 dpavlin 2 use Data::Dumper;
24 dpavlin 47 use MWS::SWISH;
25 dpavlin 4 use Template;
26 dpavlin 1
27     my $debug = 1;
28    
29 dpavlin 47 my $s = shift @ARGV;
30 dpavlin 1
31 dpavlin 47 my $config_file = 'global.conf';
32     if (-f $s) {
33     $config_file = $s;
34     # print STDERR "using $config_file\n";
35     $s = '';
36     }
37 dpavlin 1
38 dpavlin 47 my $mws = MWS::SWISH->new(config_file=>$config_file);
39    
40     $s.=join(" ",@ARGV);
41    
42 dpavlin 2 my $results = $mws->search($s);
43 dpavlin 1 print "$results results...\n";
44    
45 dpavlin 4 my $t = Template->new({
46     INCLUDE_PATH => $mws->{config}->val('global', 'templates'),
47     });
48 dpavlin 1
49 dpavlin 4 my @res = $mws->fetch_all_results();
50    
51     $t->process("results.txt", {
52     query => $s,
53     results => \@res,
54     }) || die $t->error();
55    

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26