bengaluru-food-census/bootstrap.sh

21 lines
485 B
Bash
Executable File

#!/bin/bash
ZOMATO_ROOT_URL=https://www.zomato.com
ZOMATO_CITY=bangalore
DIRECTORY_URL="$ZOMATO_ROOT_URL/$ZOMATO_CITY/directory"
USER_AGENT="Mozilla/Gecko/Firefox/58.0"
mkdir -p html
function dl() {
echo "[+] $2"
curl -sS --http2-prior-knowledge --compressed -H "User-Agent: $USER_AGENT" $1 > "html/$2"
}
dl "$DIRECTORY_URL" "directory.html"
while read -r LINK; do
FILENAME="$(basename $LINK).html"
dl "$LINK" "$FILENAME"
done <<< $(bundle exec ruby parse_dir.rb)