From 20a24d87b0c1fa19247cd015e2ef570480421a75 Mon Sep 17 00:00:00 2001 From: Anatoly Kopyl Date: Wed, 25 Nov 2020 20:20:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=BE=D1=82=D0=B8=D1=84=D0=B8=D0=BA=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scraper.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scraper.sh b/scraper.sh index 4e8c0c5..34a1e3e 100755 --- a/scraper.sh +++ b/scraper.sh @@ -8,12 +8,16 @@ sed 's|href="|http://avito.ru|g' | sed 's|"||g') echo "$list" | while read -r url do - curl -s -H "$UA" -L $url | + price=$(curl -s -H "$UA" -L $url | grep 'itemprop="price"' | ggrep -oP '(?<=content=").*?(?=")' | - head -1 + head -1) - echo $url + echo $price $url + if (($price <= 9000)) && (($price >= 6000)); then + echo $price, $url >> output.csv + osascript -e "display notification \"Нашел за $price\"" + fi - sleep 12; + sleep 12 done \ No newline at end of file