commit 7f72ae0561ccefbfea9974ee5e7ff85da127049e
parent 635a15aae05dd19cdaa64fee65e582a82beee047
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Fri, 24 Apr 2015 00:24:45 -0600
product_scraper: first pass at incorrect manufacturer spelling
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/product_scraper b/product_scraper
@@ -139,6 +139,18 @@ sub mem_exp_scrape_class
$old++;
}
else {
+ $sql = qq{select manufacturer from products where
+ lower(manufacturer) = ?};
+ my $manufs = $dbh->selectcol_arrayref($sql, undef, lc($brand));
+ if ($manufs) {
+ # take a risk that the first one is spelled right
+ if ($manufs->[0] ne $brand) {
+ print "warn: forcing misspelled $brand to ";
+ print $manufs->[0] . "\n";
+ $brand = $manufs->[0];
+ }
+ }
+
$insert_sth->execute($part_num, $brand, "Memory Express", $type,
time, time, 0) or die $dbh->errstr();
print "$thumb_hdr: inserted into db\n" if ($args{v});