0.2
+ Cleanups
+ License change
++ Some db improvements
++ Default config file added
++ Updated requirements file
0.1
+ initial release
-# update the uniqe domains
+# update the unique domains
my $queryStr = "INSERT IGNORE INTO unique_domain (url) select DISTINCT(baseurl) as url FROM url_to_fetch WHERE fetch_failed = 0";
sayLog($queryStr) if $DEBUG;
my $query = $dbh->prepare($queryStr);
# Config
-Edit `config.txt` at least to match the database server settings.
+Copy `config.default.txt` to `config.txt` and edit at least to match the database server settings.
Make sure the directory `storage` can be written.
## DB connection
my %dbAttr = (
PrintError=>0,# turn off error reporting via warn()
- RaiseError=>1 # turn on error reporting via die()
+ RaiseError=>1, # turn on error reporting via die()
+ AutoCommit=>0 # manually use transactions
);
my $dbDsn = "DBI:mysql:database=".$config->get("DB_NAME").";host=".$config->get("DB_HOST").";port=".$config->get("DB_PORT");
my $dbh = DBI->connect($dbDsn,$config->get("DB_USER"),$config->get("DB_PASS"), \%dbAttr);
$query->bind_param(1,$idToUpdate);
$query->execute();
}
- #$query->finish();
+ $dbh->commit();
sayGreen "Update fetch timestamps done";
}
$query->bind_param(1,$idToUpdate);
$query->execute();
}
- #$query->finish();
+ $dbh->commit();
sayGreen "Update fetch failed done";
}
@links = cleanLinks($dbh, \@links, \@urlStringsToIgnore);
insertIntoDb($dbh, \@links);
-
$dbh->disconnect();
-say CLEAR,GREEN, "Parse complete", RESET;
+sayGreen "Parse complete";
## cleanup the found links