A Node.js automation tool for Stack Overflow that simulates browser-based interactions to improve content quality and explore web automation workflows.
Built in 2021 as an educational project using Puppeteer, it supports automated voting, spell-checking, and post editing. The system includes tag-based question discovery, mistake detection outside code blocks, scoring for multi-error posts, structured logging, and rate-limit aware execution with daily combined workflows for voting and editing tasks.
- 🗳️ Automated voting on questions with specific tags
- ✏️ Spell-checking and grammar correction on posts
- 🔍 Smart detection of mistakes outside code blocks
- 📊 Scoring system for multi-mistake posts
- 🤖 Daily automation combining voting and editing
- 📈 Activity logging and reporting
- Automated Voting: Cast votes on questions with specific tags
- Spell-Checking: Correct spelling and grammar on posts
- Mistake Detection: Identify errors outside code blocks
- Scoring System: Score posts with multiple errors
- Daily Automation: Combine voting and editing in daily workflows
- Activity Logging: Log all actions for review
- Browser Automation: Built with Puppeteer for realistic interactions
- Rate Limiting: Respectful execution with delays
- Structured Logging: Comprehensive activity tracking
- Configuration Management: Flexible setup via config files
- Testable Design: Modular architecture for easy testing
- Clear Configuration: Easy to set up and customize
- Comprehensive Documentation: Detailed setup and usage guides
- Modular Codebase: Organized for maintainability
- Ethical Guidelines: Built-in best practices for responsible use
Start the application to access the main menu:
npm startRun specific scripts directly:
# Vote script
npm run vote
# Fix script
npm run fix
# Daily automation script
npm run dailyThis project follows clean architecture principles:
- Separation of Concerns: Each component has a single responsibility
- Modularity: Code organized into logical modules (scripts, services, utils)
- Configuration-Driven: Behavior controlled via configuration files
- Rate Limiting: Built-in respect for Stack Overflow's limits
- Ethical Design: Prioritizes responsible use of the platform
- Testability: Code structured for easy unit and integration testing
flowchart TB
Start([Start Bot])
Start --> Config[Load Configuration]
Config --> Auth[Authenticate with Stack Overflow]
Auth --> Mode{Select Mode}
Mode -->|Vote| VoteFlow[Vote Script]
Mode -->|Fix| FixFlow[Fix Script]
Mode -->|Daily| DailyFlow[Daily Script]
VoteFlow --> FindQuestions[Find Questions by Tags]
FindQuestions --> RandomSelect[Random Selection]
RandomSelect --> CastVotes[Cast Votes]
CastVotes --> LogVote[Log Actions]
FixFlow --> ScanPosts[Scan Posts for Mistakes]
ScanPosts --> DetectPattern[Pattern Detection]
DetectPattern --> CalcScore[Calculate Score]
CalcScore --> ApplyFix[Apply Corrections]
ApplyFix --> LogFix[Log Corrections]
DailyFlow --> VotePhase[Voting Phase<br/>20 votes]
VotePhase --> EditPhase[Edit Phase<br/>N posts]
EditPhase --> Report[Generate Report]
LogVote --> RateLimit{Rate Limit Check}
LogFix --> RateLimit
Report --> RateLimit
RateLimit -->|Wait| Delay[Apply Delay]
RateLimit -->|Continue| NextOp{More Operations?}
Delay --> NextOp
NextOp -->|Yes| Mode
NextOp -->|No| End([End])
style Start fill:#90EE90
style End fill:#FFB6C1
style Auth fill:#87CEEB
style RateLimit fill:#FFD700
- Strategy Pattern: Different execution strategies for vote, fix, and daily workflows
- Factory Pattern: Dynamic script loading and execution
- Repository Pattern: Configuration and data management
- Observer Pattern: Logging and event tracking
- Singleton Pattern: Configuration and logger instances
stackoverbot/
├── .github/ # GitHub configuration
│ └── rulesets/ # Repository rules
├── .vscode/ # VS Code settings
├── misc/ # Miscellaneous files
│ └── documents/ # Planning and task documents
├── src/ # Source code
│ ├── index.js # Application entry point
│ ├── scripts/ # Main automation scripts
│ ├── services/ # Business logic
│ ├── utils/ # Utility functions
│ └── config/ # Configuration management
├── .eslintrc # ESLint configuration
├── .gitignore # Git ignore rules
├── .prettierrc # Prettier configuration
├── CHANGELOG.md # Version history
├── CODE_OF_CONDUCT.md # Code of conduct
├── CONTRIBUTING.md # Contribution guidelines
├── INSTRUCTIONS.md # Detailed usage instructions
├── LICENSE # License file
├── README.md # This file
├── SECURITY.md # Security policy
└── package.json # Project dependencies and scripts
- Node.js (v14 or higher)
- NPM package manager
- Stack Overflow account (development account recommended for testing)
- Modern web browser (Chrome/Chromium for Puppeteer)
- Clone the repository:
git clone https://github.com/orassayag/stackoverbot.git
cd stackoverbot- Install dependencies:
npm install-
Configure the application (see Configuration section)
-
Run the application:
npm startConfigure the bot behavior in your configuration file:
accountEmail: Stack Overflow account emailaccountPassword: Stack Overflow account password (use environment variables)targetTags: Array of tags to target for votingvoteCount: Number of votes per run (default: 20)editCount: Number of posts to edit per run
delayBetweenActions: Milliseconds between operations (default: 5000)spellCheckPatterns: Custom regex patterns for spell checkingscoreThreshold: Minimum score for multi-mistake detectionheadless: Run browser in headless mode (default: true)
Performs automated voting on random questions:
npm run voteScans and fixes spelling mistakes on posts:
npm run fixRuns daily automation (voting + editing):
npm run dailyCreates backup of configuration and data:
npm run backupsequenceDiagram
participant User
participant Bot
participant Browser
participant StackOverflow
User->>Bot: Start Daily Script
Bot->>Browser: Launch Puppeteer
Browser->>StackOverflow: Navigate & Authenticate
StackOverflow-->>Browser: Session Created
loop Voting Phase (20 times)
Bot->>Browser: Find Questions by Tag
Browser->>StackOverflow: Query Questions
StackOverflow-->>Browser: Questions List
Bot->>Browser: Select Random Question
Browser->>StackOverflow: Cast Vote
StackOverflow-->>Browser: Vote Registered
Bot->>Bot: Wait (Rate Limit)
end
loop Editing Phase (N times)
Bot->>Browser: Scan Posts
Browser->>StackOverflow: Get Post Content
StackOverflow-->>Browser: Post Data
Bot->>Bot: Detect Spelling Mistakes
Bot->>Bot: Calculate Score
Bot->>Browser: Apply Corrections
Browser->>StackOverflow: Submit Edit
StackOverflow-->>Browser: Edit Saved
Bot->>Bot: Wait (Rate Limit)
end
Bot->>User: Generate Report
Browser->>Browser: Close
This bot must be used responsibly and in compliance with:
- Stack Overflow Terms of Service
- Stack Overflow API Guidelines
- Community guidelines and best practices
- Test First: Always test on development accounts for 2-3 weeks
- Rate Limiting: Implement generous delays between operations
- Captcha Respect: Stop automation if captcha appears
- Quality Edits: Only make edits that genuinely improve content
- No Spam: Avoid repetitive or low-quality actions
- Transparency: Consider disclosing bot usage where appropriate
Users are responsible for ensuring their use of this tool complies with all applicable laws, terms of service, and community guidelines. The author assumes no liability for misuse.
This project is currently in planning stage. The core functionality described in this README is based on the original design specifications found in misc/documents/todo_tasks.txt.
Contributions to this project are released to the public under the project's open source license.
Everyone is welcome to contribute. Contributing doesn't just mean submitting pull requests—there are many different ways to get involved, including answering questions and reporting issues.
Please feel free to contact me with any question, comment, pull-request, issue, or any other thing you have in mind.
For questions, issues, or contributions:
- GitHub Issues: https://github.com/orassayag/stackoverbot/issues
- Email: orassayag@gmail.com
- Or Assayag - Initial work - orassayag
- Or Assayag orassayag@gmail.com
- GitHub: https://github.com/orassayag
- StackOverflow: https://stackoverflow.com/users/4442606/or-assayag?tab=profile
- LinkedIn: https://linkedin.com/in/orassayag
This application has an MIT license - see the LICENSE file for details.
- Built for educational and research purposes
- Respects robots.txt and implements rate limiting
- Uses user-agent rotation to avoid detection
- Implements polite crawling practices