From 5251ea30bcf7a3d0a695200ef54eb817c31a4b2b Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Wed, 18 Dec 2019 11:14:18 -0500 Subject: [PATCH] start on building sql --- .gitignore | 1 + build_sql.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .gitignore create mode 100644 build_sql.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b84df0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.html \ No newline at end of file diff --git a/build_sql.sh b/build_sql.sh new file mode 100644 index 0000000..f2e4bfc --- /dev/null +++ b/build_sql.sh @@ -0,0 +1,27 @@ +echo "INSERT INTO scrape.raw (code,url, html) SELECT 'g_basket' code, 'https://hc-companies.com/planter_category/hanging-baskets-greenhouse/' url, \$\$" | cat - g_basket.html >temp +echo "\$\$ html ON CONFLICT (code,url) DO UPDATE SET html = EXCLUDED.html" >> temp +mv temp g_basket_mod.html + + +#greenhouse decorative +#wget https://hc-companies.com/planter_category/decorative-containers/ -O g_deco.html +echo "INSERT INTO scrape.raw (code,url, html) SELECT 'g_deco' code, 'https://hc-companies.com/planter_category/decorative-containers/' url, \$\$" | cat - g_basket.html >temp +echo "\$\$ html ON CONFLICT (code,url) DO UPDATE SET html = EXCLUDED.html" >> temp +mv temp g_deco.html + +#greenhouse baskets +wget https://hc-companies.com/planter_category/hanging-baskets-greenhouse/ -O g_basket.html +#greenhouse round +wget https://hc-companies.com/planter_category/round-containers/ -O g_round.html +#greenhouse square +wget https://hc-companies.com/planter_category/square-containers/ -O g_square.html +#greenhouse support +wget https://hc-companies.com/planter_category/support-systems-greenhouse/ -O g_support.html +#greenhouse trays flats +wget https://hc-companies.com/planter_category/trays-flats-sheets-greenhouse/ -O g_trays.html +#nursery round +wget https://hc-companies.com/planter_category/round-containers-nursery/ -O n_round.html +#nursery flats and sheets +wget https://hc-companies.com/planter_category/trays-flats-sheets-nursery/ -O n_flats.html +#consumer bohemian +wget https://hc-companies.com/planter_category/bohemian/ -O c_bohemian.html