I've placed a new perl module in the ConfigDig CVS repository that provides
object-oriented processing of htsearch's output. I'd love to get some comments
on it from the developers on this list (who know htdig the best, anyway)
prior to working up the next ConfigDig release. Just to whet your
appetite, it should allow you to run queries like this in your perl scripts:
use HtDig::Search '/opt/www/cgi-bin/htsearch'; #put path to your htsearch here
$srch = new HtDig::Search(trace_lvl=>2); #debug level 2
#Note how the path to the conf file is used. All columns that are valid in
# htsearch's templates are valid here, and the where clause includes
# "words=" for the keywords, and any other valid htsearch conf options
my $hits = $srch->execute("select URL, TITLE, SIZE from
'/opt/www/htdig/conf/htdig.conf' where words='jacob' and pagesize=1");
print "$hits hits\n";
while(my @arr = $srch->fetchrow_array) {
print join(",", @arr) . "\n";
}
#You can also get the whole result set in an array ref:
print "Test array ref...\n";
print $srch->execute(qq|select URL, TITLE, SIZE from '/opt/www/htdig/conf/htdig.conf'
where words='jacob' and pagesize=1|) . " hits\n";
my $arr = $srch->fetchrow_arrayref;
for my $row (@$arr) {
print join(",", @$row) . "\n";
}
##END
Let me know if it sucks/rules/just sits there...
The module has POD embedded in it, so running 'perldoc Search.pm'
will get you more detailed info.
Instructions on reaching the CVS repository can be found at:
http://sourceforge.net/cvs/?group_id=970
I'd suggest checking out the whole thing (not big) and then running a standard
perl build using the README document as a guide.
For those interested, there's also a command shell for the ConfigDig system in
CVS as well, but it's still needing work.
Jamie
------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED]
You will receive a message to confirm this.