#!/usr/bin/env perl # # $Id: indexer,v 1.1 2025/06/25 19:38:48 snw Exp $ # Copyright (C) 2025 Coherent Logic Development LLC # # Author: Serena Willis # # Licensed AGPL-3.0 # # $Log: indexer,v $ # Revision 1.1 2025/06/25 19:38:48 snw # Add indexer # # use Getopt::Long; use HTTP::Tiny; use HTML::TreeBuilder; use URI; use DBI; my $dbh = ""; my $dsn = ""; print "pandia indexer v0.0.1\n"; print " Copyright (C) 2025 Coherent Logic Development LLC\n\n"; GetOptions("dbhost=s" => \$dbhost, "dbname=s" => \$dbname, "dbusername=s" => \$dbusername, "dbpw=s" => \$dbpw) or die("error in command line arguments"); print "pandia: connecting to $dbname database at $dbhost..."; $dsn = "DBI:mysql:database=$dbname;host=$dbhost;port=3306;mysql_connect_timeout=5;"; $dbh = DBI->connect($dsn, $dbusername, $dbpw, {RaiseError => 0, PrintError => 0}); die "pandia: failed to connect to MySQL database: DBI->errstr()" unless $dbh; print "[OK]\n";