commit ffb768842530a1217cf308a5e13273496c7259fe
parent 975f24a9d48c1b1797ac332be14bf116a8cb5ae1
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Sun, 15 Mar 2015 18:09:40 -0600
index.html: include # of new products in title
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gen_index b/gen_index
@@ -40,15 +40,16 @@ $query = "select count(distinct vendor) from prices";
my ($v) = $dbh->selectrow_array($query);
my $time = time - (7 * 24 * 60 * 60);
-$query = "select description, part_num from products where first_seen > $time";
+$query = "select description from products where first_seen > $time";
my $new_products = $dbh->selectall_arrayref($query);
-my $n = @$new_products;
+my $n = @$new_products;
print "info: $m manufacturers, $p products ($n new), $v vendors\n" if ($args{v});
my $vars = {
num_vendors => $v,
num_manufacturers => $m,
num_products => $p,
+ num_new => $n,
new_products => $new_products
};
diff --git a/html/index.tt2 b/html/index.tt2
@@ -36,10 +36,10 @@
</div>
<div class="column">
- <h1>New Products</h1>
+ <h1>New Products ([% num_new %])</h1>
<ul>
[% FOREACH new_product IN new_products %]
- <li>[% new_product.0 %] [% new_product.1 %]
+ <li>[% new_product.0 %]
[% END %]
</ul>
</div>