pricecharts

track prices of consumer electronics
Log | Files | Refs | README

commit 3e441fee77f5fa1e97a7f6ad180e5330ed27620f
parent 8e09aa5661fbbf1656c475523d47b99093461525
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Thu, 12 Mar 2015 01:20:22 -0600

PriceChart: print which db we're opening

Diffstat:
MPriceChart.pm | 6++++--
Mproduct_scraper.pl | 2+-
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/PriceChart.pm b/PriceChart.pm @@ -54,15 +54,17 @@ sub get_dbh { my $cfg = shift; my $db_dir = shift || $cfg->{"db"}; - mkdir $db_dir; + my $verbose = shift || undef; + mkdir $db_dir; my $dbh = DBI->connect( "dbi:SQLite:dbname=$db_dir/pricechart.db", "", "", - { RaiseError => 1 } + {RaiseError => 1} ) or die $DBI::errstr; + print "info: get_dbh: opened $db_dir/pricechart.db\n" if ($verbose); return $dbh; } diff --git a/product_scraper.pl b/product_scraper.pl @@ -21,7 +21,7 @@ $| = 1 if ($args{v}); my $cfg = get_config(); my $ua = new_ua($cfg->{"general"}, $args{v}); -my $dbh = get_dbh($cfg->{"general"}); +my $dbh = get_dbh($cfg->{"general"}, undef, $args{v}); # my $log = get_log("products.txt", $args{v}); srand;