scrape/build_sql.sh
2019-12-18 15:32:02 -05:00

9 lines
420 B
Bash

#!/bin/bash
#greenhouse decorative
code=g_deco
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"