commit 01b99ce0d28bc1e598084e4714f6ae5a950e3095
parent 8c899a15a8c3a97753bad9e53c1f4f3389d503b4
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Sat, 18 Apr 2015 01:32:34 -0600
gen_html: reduce whitespace, fix logging
Diffstat:
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/gen_html b/gen_html
@@ -46,11 +46,11 @@ my $sql_1 = qq{select distinct prices.manufacturer from prices, products where
 	group by prices.manufacturer having count(distinct prices.part_num) > 1};
 
 my $sql_2 = qq{select distinct products.type from prices, products where
-	prices.manufacturer = products.manufacturer and
-	prices.part_num = products.part_num and prices.manufacturer = ?};
+	prices.manufacturer = products.manufacturer and prices.manufacturer = ?
+	and prices.part_num = products.part_num};
 
-my $sql_3 = qq{select distinct manufacturer, part_num
-	from products where type = ? and manufacturer = ?};
+my $sql_3 = qq{select distinct manufacturer, part_num from products
+	where type = ? and manufacturer = ?};
 
 generate_folder($sql_1, $sql_2, $sql_3, "manufacturers", "Manufacturers");
 
@@ -70,10 +70,9 @@ $sql_2 = qq{select distinct products.type from prices, products where
 	prices.part_num = products.part_num and prices.retailer = ?};
 
 $sql_3 = qq{select distinct prices.manufacturer, prices.part_num
-	from prices, products where
-	prices.part_num = products.part_num and
-	products.manufacturer = prices.manufacturer
-	and products.type = ? and prices.retailer = ?};
+	from prices, products where prices.part_num = products.part_num and
+	products.manufacturer = prices.manufacturer and products.type = ? and
+	prices.retailer = ?};
 
 generate_folder($sql_1, $sql_2, $sql_3, "retailers", "Retailers");
 
@@ -90,8 +89,7 @@ $sql_2 = qq{select distinct products.manufacturer from prices, products where
 	prices.part_num = products.part_num and products.type = ?};
 
 $sql_3 = qq{select distinct prices.manufacturer, prices.part_num
-	from prices, products where
-	prices.part_num = products.part_num and
+	from prices, products where prices.part_num = products.part_num and
 	products.manufacturer = prices.manufacturer and
 	products.manufacturer = ? and products.type = ?};
 
@@ -129,17 +127,16 @@ $sql = "select manufacturer, part_num from products where last_seen > ? order by
 my $upds = $dbh->selectall_arrayref($sql, undef, time - (1 * 60 * 60));
 
 #
-# index.html
+# index
 #
 my $vars = {
 	nret => 66, nmanuf => 99, nprod => $num_products,
 	nnew => scalar @$news, news => $news, nupd => scalar @$upds, upds => $upds
 };
-print "info: index.html\n" if ($args{v});
+print "info: index\n" if ($args{v});
 $template->process("index.tt", $vars, "index.html")
 	or die "template: " . $template->error() . "\n";
 
-
 #
 # svg
 #