<?php
$files = glob("viewed_step_*.txt");
foreach ($files as $file) {
    $content = file_get_contents($file);
    if (stripos($content, 'drive.google.com') !== false || stripos($content, 'lh3.googleusercontent') !== false) {
        $lines = explode("\n", $content);
        foreach ($lines as $i => $line) {
            if (stripos($line, 'drive.google.com') !== false || stripos($line, 'lh3.googleusercontent') !== false) {
                // If it contains a google drive file id or image url
                if (preg_match('/1[a-zA-Z0-9_-]{32}/', $line, $matches)) {
                    echo "Found link in $file (line " . ($i + 1) . "): " . trim($line) . "\n";
                }
            }
        }
    }
}
