pricecharts

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

commit 40f466064be0380d3d613a9edae6440d1dc170c6
parent b4cad1a071a724a9b6fa932681a221b1bfadb3b2
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Mon,  3 Nov 2014 22:16:27 -0700

product_scraper: rename product_sth -> exists_sth

Diffstat:
Mproduct_scraper.pl | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/product_scraper.pl b/product_scraper.pl @@ -39,7 +39,7 @@ tee("$vendor\n"); tee("=") for (1..length $vendor); tee("\n\n"); -my $product_sth = $dbh->prepare("select * from products where part_num = ?"); +my $exists_sth = $dbh->prepare("select * from products where part_num = ?"); my $qry = "insert into products(part_num, manufacturer, description, type, " . "first_seen, last_seen, last_scraped) values (?, ?, ?, ?, ?, ?, ?)"; @@ -110,8 +110,8 @@ for (keys %product_map) { next; } - $product_sth->execute($part_num); - if ($product_sth->fetchrow_arrayref()) { + $exists_sth->execute($part_num); + if ($exists_sth->fetchrow_arrayref()) { $update_sth->execute(time, $part_num); vprint(" ($part_num) $brand $description\n"); $old++; @@ -131,7 +131,7 @@ for (keys %product_map) { $new + $old, scalar @thumbnails, $new, time - $start)); } -$product_sth->finish(); +$exists_sth->finish(); $dbh->disconnect(); my $e_mail = Email::Simple->create(