pricecharts

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

commit 73947de7db5730274efcb7b38477e7b4b4f2cb96
parent e2183f6b8427f9aa5b6bd3d595e5418d8933cc36
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Mon, 16 Mar 2015 00:12:46 -0600

pricechart.cfg: remove general db option

Diffstat:
MPriceChart.pm | 3+--
Mgen_index | 2+-
Mgen_svg | 2+-
Mpc_fcgi | 2+-
Mprice_scraper | 2+-
Mproduct_scraper | 2+-
6 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/PriceChart.pm b/PriceChart.pm @@ -16,7 +16,6 @@ sub get_config 'user_agent', 'email', 'smtp', - "db" ], }, http => { @@ -53,7 +52,7 @@ sub get_config sub get_dbh { my $cfg = shift; - my $db_dir = shift || $cfg->{"db"}; + my $db_dir = shift || $cfg->{"chroot"} . $cfg->{"db_dir"}; my $verbose = shift || undef; mkdir $db_dir; diff --git a/gen_index b/gen_index @@ -16,7 +16,7 @@ getopts("v", \%args); $| = 1 if ($args{v}); my $cfg = get_config(); -my $dbh = get_dbh($cfg->{"general"}); +my $dbh = get_dbh($cfg->{"http"}, undef, $args{v}); my $work_dir = $cfg->{"http"}{"chroot"} . $cfg->{"http"}{"htdocs"}; print "info: work dir: $work_dir\n" if ($args{v}); diff --git a/gen_svg b/gen_svg @@ -17,7 +17,7 @@ $| = 1 if ($args{v}); # my $log = get_log("gen_svg"); my $cfg = get_config(); -my $dbh = get_dbh($cfg->{"general"}); +my $dbh = get_dbh($cfg->{"http"}, undef, $args{v}); my $svg_dir = $cfg->{"http"}{"chroot"} . $cfg->{"http"}{"htdocs"} . "/svg"; print "info: rendering svgs to $svg_dir\n" if ($args{v}); diff --git a/pc_fcgi b/pc_fcgi @@ -66,7 +66,7 @@ my $socket = FCGI::OpenSocket($socket_file, 1024); my $db_dir = $http_cfg{"db_dir"}; print "info: opening $db_dir/pricechart.db\n" if ($args{v}); -my $dbh = get_dbh($cfg->{"general"}, $db_dir); +my $dbh = get_dbh($cfg->{"http"}, $db_dir, $args{v}); my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket, FCGI::FAIL_ACCEPT_ON_INTR); diff --git a/price_scraper b/price_scraper @@ -22,7 +22,7 @@ $| = 1 if ($args{v}); my $cfg = get_config(); my $ua = new_ua($cfg->{"general"}, $args{v}); -my $dbh = get_dbh($cfg->{"general"}, undef, $args{v}); +my $dbh = get_dbh($cfg->{"http"}, undef, $args{v}); my $log_path = $cfg->{"http"}{"chroot"} . $cfg->{"http"}{"logs"} . "/price_scrapes.txt"; my $log = get_log($log_path, $args{v}); diff --git a/product_scraper b/product_scraper @@ -22,7 +22,7 @@ $| = 1 if ($args{v}); my $cfg = get_config(); my $ua = new_ua($cfg->{"general"}, $args{v}); -my $dbh = get_dbh($cfg->{"general"}, undef, $args{v}); +my $dbh = get_dbh($cfg->{"http"}, undef, $args{v}); my $tmp_file = "/tmp/product_scraper.txt"; my $log = get_log($tmp_file, $args{v}); srand;