glam/scripts/run_linkedin_fetcher.sh
2025-12-12 12:51:10 +01:00

53 lines
No EOL
1.6 KiB
Bash
Executable file

#!/bin/bash
# Quick run script for LinkedIn profile fetching
echo "LinkedIn Profile Fetcher - Quick Start"
echo "===================================="
echo ""
echo "This will fetch LinkedIn profiles from all staff directories."
echo "Loading environment from .env file..."
echo ""
# Load .env file if it exists
if [ -f ".env" ]; then
set -a
while IFS= read -r line; do
# Skip comments and empty lines
[[ $line =~ ^[[:space:]]*# ]] && continue
[[ -z $line ]] && continue
# Export valid KEY=VALUE pairs
if [[ $line =~ ^[[:space:]]*([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then
export "${BASH_REMATCH[1]}=${BASH_REMATCH[2]}"
fi
done < .env
echo "✓ Loaded .env file"
else
echo "Warning: .env file not found"
fi
# Check if token is set
if [ -z "$ZAI_API_TOKEN" ]; then
echo "Error: ZAI_API_TOKEN is not set!"
echo ""
echo "To set it temporarily:"
echo " export ZAI_API_TOKEN=your_token_here"
echo " ./run_linkedin_fetcher.sh"
echo ""
echo "To set it permanently, add to your ~/.bashrc or ~/.zshrc:"
echo " export ZAI_API_TOKEN=your_token_here"
exit 1
fi
echo "✓ ZAI_API_TOKEN is set"
echo ""
echo "Usage: ./scripts/run_linkedin_fetcher.sh [batch_size]"
echo " batch_size: Number of profiles to fetch (optional)"
echo ""
echo "Examples:"
echo " ./scripts/run_linkedin_fetcher.sh # Interactive mode"
echo " ./scripts/run_linkedin_fetcher.sh 50 # Fetch first 50 profiles"
# Run the Python script
cd /Users/kempersc/apps/glam
python scripts/fetch_linkedin_profiles_complete.py