#!/usr/bin/env bash
set -euo pipefail

QUERIES=(
	"weather oslo"
	"migraine symptoms"
	"vitamin d deficiency"
	"running shoes"
	"coffee grinder"
	"best laptop for students"
	"electric car charging"
	"cheap flights to london"
	"home insurance"
	"python list tutorial"
	"banana bread recipe"
	"news norway"
)

for query in "${QUERIES[@]}"; do
	echo "Running query: $query"

	capture_search_har \
		--query "$query" \
		--browser chromium \
		--wait-until load \
		--headed \
		--output-dir normal_chromium \
		--timeout-ms 60000

	capture_search_har \
		--query "$query" \
		--browser chromium \
		--wait-until load \
		--headed \
		--output-dir tor_chromium \
		--timeout-ms 60000 \
		--proxy socks5://127.0.0.1:9050

	capture_search_har \
		--query "$query" \
		--browser firefox \
		--wait-until load \
		--headed \
		--output-dir tor_firefox \
		--timeout-ms 60000 \
		--proxy socks5://127.0.0.1:9050

	capture_search_har \
		--query "$query" \
		--browser firefox \
		--wait-until load \
		--headed \
		--output-dir normal_firefox \
		--timeout-ms 60000
done
