scrape/build_sql.sh

9 lines
420 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 15:32:02 -05:00
code=g_deco
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"