start on building sql

This commit is contained in:
Trowbridge 2019-12-18 11:14:18 -05:00
parent 2d03c8f9df
commit 5251ea30bc
2 changed files with 28 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.html

27
build_sql.sh Normal file
View File

@ -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