// Helper script to run IndexNow submission
// Run with: npm run submit:indexnow

import { getAllIndexableUrls, submitToIndexNow } from '../src/lib/indexnow';

async function main() {
    console.log('🚀 Starting IndexNow Submission Script...');

    console.log('   Gathering URLs for IndexNow submission...');
    const urls = getAllIndexableUrls();
    console.log(`   Found ${urls.length} indexable URLs.`);

    // Basic validation of key presence (logic can be improved)
    if (!process.env.INDEXNOW_KEY) {
        console.warn('⚠️  WARNING: INDEXNOW_KEY environment variable is not set.');
        console.warn('   The submission might fail if the key is not hardcoded in src/lib/indexnow.ts');
    }

    await submitToIndexNow(urls);
    console.log('\n✨ IndexNow submission process completed.');
}

main().catch(console.error);
