scrape/build_sql.sh

10 lines
502 B
Bash
Raw Normal View History

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