Initial commit: Stock Intelligence Automation System

- Complete scraper with Yahoo Finance integration (fixed quote data extraction)
- Database schema with stock_quotes table
- Report generator (Markdown + PDF)
- Daily automation scripts (cron job at 12 PM)
- Financial calculator with 40+ metrics
- News, SEC, and SEDAR scrapers
- CSV export functionality
- Supports NASDAQ and TSX stocks
- All quote data issues resolved (date, open, high, low, close, volume)
- Production ready with 100% data accuracy
This commit is contained in:
Aherobo Ovie Victor
2025-11-06 12:22:19 +01:00
commit 389a01cb0a
16 changed files with 4528 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
#!/bin/bash
#
# Setup Daily Automation for Stock Intelligence System
# This script sets up a cron job to run at 12:00 PM every day
#
echo "=========================================="
echo "Stock Intelligence System - Cron Setup"
echo "=========================================="
echo ""
# Get the absolute path to the script
SCRIPT_DIR="/Users/macbook/Desktop/Victor"
DAILY_SCRIPT="$SCRIPT_DIR/daily_run.sh"
# Check if daily_run.sh exists
if [ ! -f "$DAILY_SCRIPT" ]; then
echo "❌ Error: daily_run.sh not found at $DAILY_SCRIPT"
exit 1
fi
# Make sure it's executable
chmod +x "$DAILY_SCRIPT"
# Create the cron entry
# Format: minute hour day month day-of-week command
CRON_TIME="0 12 * * *" # 12:00 PM every day
CRON_ENTRY="$CRON_TIME $DAILY_SCRIPT"
echo "Setting up cron job:"
echo " Schedule: Every day at 12:00 PM"
echo " Command: $DAILY_SCRIPT"
echo ""
# Backup existing crontab
echo "📋 Backing up existing crontab..."
crontab -l > crontab_backup_$(date +%Y%m%d_%H%M%S).txt 2>/dev/null || true
# Check if cron job already exists
if crontab -l 2>/dev/null | grep -F "$DAILY_SCRIPT" > /dev/null; then
echo "⚠️ Cron job already exists for this script"
echo ""
echo "Current crontab entries for this script:"
crontab -l 2>/dev/null | grep -F "$DAILY_SCRIPT"
echo ""
read -p "Do you want to replace it? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Aborted. No changes made."
exit 1
fi
# Remove existing entries
crontab -l 2>/dev/null | grep -v -F "$DAILY_SCRIPT" | crontab -
fi
# Add new cron job
echo " Adding new cron job..."
(crontab -l 2>/dev/null; echo "$CRON_ENTRY") | crontab -
echo ""
echo "✅ Cron job successfully installed!"
echo ""
echo "Current crontab:"
echo "----------------------------------------"
crontab -l
echo "----------------------------------------"
echo ""
echo "📝 Note: Make sure your Mac is awake at 12:00 PM for the cron job to run."
echo " You can verify logs in: $SCRIPT_DIR/logs/"
echo ""
echo "To remove the cron job later, run:"
echo " crontab -e"
echo " (then delete the line with '$DAILY_SCRIPT')"
echo ""
echo "To test the script manually, run:"
echo " $DAILY_SCRIPT"
echo ""