An automated Node.js tool using Puppeteer to streamline submissions to multiple web directories. This bot reads directory information from a CSV file, visits each site, analyzes submission forms, and can help automate the submission process.
- ✅ Parse CSV files containing directory information
- 🌐 Automated browser navigation using Puppeteer
- 🔍 Intelligent form detection and analysis
- 📸 Screenshot capture on errors
- 📊 Detailed submission results and reporting
- ⚙️ Configurable delays and timeouts
- 🧪 Comprehensive test coverage with Mocha/Chai
- 🎨 ESLint and Prettier for code quality
- Node.js v20 or newer
- pnpm (recommended) or npm
-
Clone or download this repository
-
Install dependencies using pnpm:
pnpm installOr using npm:
npm install- Copy the example configuration file:
cp config.example.js config.js- Edit
config.jswith your information:
export default {
submission: {
name: 'Your Tool Name',
url: 'https://yourtool.com',
email: '[email protected]',
description: 'Brief description of your tool',
category: 'AI Tools',
tags: ['ai', 'automation', 'productivity'],
},
bot: {
headless: false, // Set to true for production
timeout: 30000,
delayBetweenSubmissions: 5000,
screenshotOnError: true,
},
csvPath: './directories.csv',
filter: {
onlyUnsubmitted: true,
limit: null, // Set to a number for testing
},
};Your directories.csv file should follow this format:
Directory Name,URL,Status
AI Tool Directory,https://example.com/submit,submitted
Another Directory,https://example2.com/submit,
Third Directory,https://example3.com/submit,
- Directory Name: The name of the directory
- URL: The submission or homepage URL
- Status: Leave empty for unsubmitted, or use "submitted" for completed submissions
First, inspect the production sites to analyze their submission forms and generate site-specific configurations:
pnpm inspectOr with a limit (recommended for first run):
pnpm inspect ./directories.csv 5This will:
- Visit each unsubmitted directory
- Analyze forms, fields, and submission buttons
- Generate intelligent field mappings
- Create
site-configs.jsonwith site-specific configurations - Create
site-inspection-results.jsonwith detailed analysis
After generating configurations, run the smart submission bot:
pnpm startOr:
node src/index.jsThe bot will use the generated configurations to:
- Fill forms with correct field mappings
- Handle different submission methods (forms vs links)
- Detect and pause for CAPTCHAs
- Skip sites requiring manual submission
pnpm testpnpm lintpnpm format- Parse CSV: Reads the directories.csv file and parses directory information
- Filter: Optionally filters to only unsubmitted directories
- Initialize Browser: Launches Puppeteer browser instance
- Visit Directories: For each directory:
- Navigates to the URL
- Analyzes the page for forms and input fields
- Captures screenshots on errors
- Records results
- Generate Report: Saves detailed results to
submission-results.json
.
├── src/
│ ├── index.js # Main entry point
│ ├── submission-bot.js # Puppeteer bot class
│ └── utils/
│ └── csv-parser.js # CSV parsing utilities
├── test/
│ └── csv-parser.test.js # Test suite
├── config.example.js # Example configuration
├── directories.csv # Your directory list
├── package.json
├── .eslintrc.json # ESLint configuration
├── .prettierrc.json # Prettier configuration
└── README.md
const bot = new SubmissionBot(config);initialize(): Initialize browser and pagevisitDirectory(url, name): Visit a directory URL and analyze the pageanalyzePage(): Analyze current page for forms and inputsfillForm(formData): Fill form with provided datasubmitForm(): Submit the current formprocessDirectories(directories, submissionData): Process multiple directoriessaveResults(results, filename): Save results to JSON fileclose(): Close the browser
import {
parseDirectoriesCSV,
filterByStatus,
getUnsubmittedDirectories
} from './src/utils/csv-parser.js';
// Parse CSV file
const directories = await parseDirectoriesCSV('./directories.csv');
// Filter by status
const submitted = filterByStatus(directories, 'submitted');
// Get unsubmitted only
const unsubmitted = getUnsubmittedDirectories(directories);| Option | Type | Default | Description |
|---|---|---|---|
headless |
boolean | false |
Run browser in headless mode |
timeout |
number | 30000 |
Page load timeout in milliseconds |
delayBetweenSubmissions |
number | 5000 |
Delay between submissions in milliseconds |
screenshotOnError |
boolean | true |
Take screenshots when errors occur |
| Option | Type | Default | Description |
|---|---|---|---|
onlyUnsubmitted |
boolean | true |
Only process unsubmitted directories |
limit |
number|null | null |
Limit number of directories to process |
The bot generates:
- Console Output: Real-time progress and results
- submission-results.json: Detailed results for each directory
- screenshots/: Error screenshots (if enabled)
[
{
"name": "AI Tool Directory",
"url": "https://example.com",
"result": {
"success": true,
"message": "Successfully visited AI Tool Directory",
"forms": [...],
"submitButtons": [...],
"inputs": [...]
},
"timestamp": "2024-01-15T10:30:00.000Z"
}
]The project includes comprehensive tests using Mocha and Chai:
# Run all tests
pnpm test
# Run tests with coverage (if configured)
pnpm test:coverageIf Puppeteer fails to launch:
# Install Chromium dependencies (Linux)
sudo apt-get install -y chromium-browser
# Or use system Chrome
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chromeIncrease timeout in config.js:
bot: {
timeout: 60000, // 60 seconds
}The bot analyzes pages but may need manual intervention for complex forms. Check the console output and screenshots for details.
- Start Small: Test with
limit: 5in config before processing all directories - Use Delays: Respect rate limits with appropriate delays between submissions
- Review Results: Always check
submission-results.jsonfor issues - Manual Verification: Some directories may require manual submission
- Keep CSV Updated: Mark directories as "submitted" to avoid duplicates
Contributions are welcome! Please ensure:
- Code passes ESLint checks
- Code is formatted with Prettier
- Tests are included for new features
- Documentation is updated
MIT
This tool is for educational and automation purposes. Always:
- Respect website terms of service
- Use appropriate delays between requests
- Verify submissions manually when required
- Follow rate limiting guidelines
For issues or questions, please check:
- This README
- The example configuration
- Test files for usage examples