#!/bin/bash

# Image Scraper Setup Script
# This script creates a virtual environment and installs all dependencies

echo "🚀 Setting up Image Scraper..."

# Check if Python 3 is installed
if ! command -v python3 &> /dev/null; then
    echo "❌ Python 3 is not installed. Please install Python 3 first."
    exit 1
fi

# Create virtual environment
echo "📦 Creating virtual environment..."
python3 -m venv venv

# Activate virtual environment
echo "🔄 Activating virtual environment..."
source venv/bin/activate

# Upgrade pip
echo "⬆️  Upgrading pip..."
python -m pip install --upgrade pip

# Install dependencies
echo "📥 Installing dependencies..."
pip install -r requirements.txt

# Make the script executable
chmod +x image_scraper.py

echo "✅ Setup complete!"
echo ""
echo "🎯 To use the image scraper:"
echo "1. Activate the virtual environment: source venv/bin/activate"
echo "2. Run the scraper: python image_scraper.py <website_url>"
echo ""
echo "Example usage:"
echo "  python image_scraper.py https://example.com"
echo "  python image_scraper.py https://example.com -o my_images --delay 2"
echo ""
echo "For more options, run: python image_scraper.py --help" 