diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-08 03:22:10 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-08 03:22:10 +0100 |
| commit | d57f244f5bf0ab7e86446d0088079fbd008d13df (patch) | |
| tree | 538a710e62effd118617728ca86ba18bcb3ded9d /search/bin | |
| parent | 192abb9db60f95968953b515ce18700c6b2da090 (diff) | |
building search index w/ old perl lib
Diffstat (limited to 'search/bin')
| -rwxr-xr-x | search/bin/build-index | 12 | ||||
| -rwxr-xr-x | search/bin/poetaster | 33 |
2 files changed, 6 insertions, 39 deletions
diff --git a/search/bin/build-index b/search/bin/build-index index b838924..02866d1 100755 --- a/search/bin/build-index +++ b/search/bin/build-index @@ -1,6 +1,6 @@ #!/usr/bin/perl use strict; -use lib "../lib"; +use lib "./search/lib"; use Bucky; use DB_File; #require Time::Stopwatch; @@ -50,11 +50,11 @@ my $file = $bucky->index_filename; print_timer($timer, "Dumped $file"); -print "NEW: " ; system("/bin/ls", "-l", "./$file"); -print "OLD: " ; system("/bin/ls", "-l", "../cgi-bin/$file"); -system("/bin/mv", "../cgi-bin/$file", "../cgi-bin/$file.1"); -system("/bin/cp", "./$file", "../cgi-bin/$file"); -system("/usr/bin/perl", "./build-autocomplete"); +system("/bin/mv", "search.db", "search.db.1"); +system("/bin/mv", "$file", "search.db"); +print "OLD: " ; system("/bin/ls", "-l", "./search.db.1"); +print "NEW: " ; system("/bin/ls", "-l", "./search.db"); +# system("/usr/bin/perl", "./build-autocomplete"); exit; sub parse_terms diff --git a/search/bin/poetaster b/search/bin/poetaster deleted file mode 100755 index fe973a5..0000000 --- a/search/bin/poetaster +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/perl -use lib "../lib"; -use Rest; -use CGI; -use Poetaster; - -my $file = $ARGV[0] || "twain"; -my $data = load_data($file); -$data =~ s/<[^>]+>//g; -$data =~ s/\r\n/ /g; -$data =~ s/\s+/ /g; -$data =~ s/\. \. \. /... /g; -my $self = new Poetaster; -my $poem = $self->poem($data); -print $poem; - -sub load_data - { - my ($file) = @_; - my $data = ''; - if ($file =~ /^http/) - { - $data = Rest->new->rest_get_raw($file); - } - else - { - local $/; - open F, $file; - $data = <F>; - close F; - } - return $data; - } |
