scrape/build_sql.sh

10 lines
502 B
Bash

#!/bin/bash
#greenhouse decorative
for f in g_basket g_deco g_round g_square g_support g_trays n_flats n_round c_bohemian
code=f
url=https://hc-companies.com/planter_category/decorative-containers
#wget https://hc-companies.com/planter_category/decorative-containers/ -O g_deco.html
echo "INSERT INTO scrape.raw (code,url, html) SELECT '$code' code, '$url' url, \$\$" | cat - "$code.html" >temp
echo "\$\$ html ON CONFLICT (code,url) DO UPDATE SET html = EXCLUDED.html" >> temp
mv temp "$code.sql"