Skip to content

orassayag/stackoverbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

StackOverBot

A Node.js automation tool for Stack Overflow that performs automated voting, spell-checking, and post editing. Built in 2021 as an educational project to explore web automation and content quality improvement on Stack Overflow.

⚠️ IMPORTANT: This project is for educational purposes. Always ensure compliance with Stack Overflow's terms of service, API guidelines, and automation policies before use.

Features

  • πŸ—³οΈ 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

Architecture

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
Loading

Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • NPM package manager
  • Stack Overflow account (development account recommended for testing)
  • Modern web browser (Chrome/Chromium for Puppeteer)

Installation

  1. Clone the repository:
git clone https://github.com/orassayag/stackoverbot.git
cd stackoverbot
  1. Install dependencies:
npm install
  1. Configure the application (see Configuration section)

  2. Run the application:

npm start

Configuration

Configure the bot behavior in your configuration file:

Required Settings

  • accountEmail: Stack Overflow account email
  • accountPassword: Stack Overflow account password (use environment variables)
  • targetTags: Array of tags to target for voting
  • voteCount: Number of votes per run (default: 20)
  • editCount: Number of posts to edit per run

Optional Settings

  • delayBetweenActions: Milliseconds between operations (default: 5000)
  • spellCheckPatterns: Custom regex patterns for spell checking
  • scoreThreshold: Minimum score for multi-mistake detection
  • headless: Run browser in headless mode (default: true)

Available Scripts

Vote Script

Performs automated voting on random questions:

npm run vote

Fix Script

Scans and fixes spelling mistakes on posts:

npm run fix

Daily Script

Runs daily automation (voting + editing):

npm run daily

Backup

Creates backup of configuration and data:

npm run backup

Project Structure

stackoverbot/
β”œβ”€β”€ misc/
β”‚   β”œβ”€β”€ backups/           # Backup files
β”‚   └── documents/         # Planning and task documents
β”œβ”€β”€ src/                   # Source code (to be implemented)
β”‚   β”œβ”€β”€ scripts/          # Main automation scripts
β”‚   β”œβ”€β”€ services/         # Business logic
β”‚   β”œβ”€β”€ utils/            # Utility functions
β”‚   └── config/           # Configuration management
β”œβ”€β”€ README.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ INSTRUCTIONS.md
β”œβ”€β”€ LICENSE
└── package.json

Workflow Diagram

sequenceDiagram
    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
Loading

Important Ethical Considerations

Stack Overflow Compliance

This bot must be used responsibly and in compliance with:

Best Practices

  1. Test First: Always test on development accounts for 2-3 weeks
  2. Rate Limiting: Implement generous delays between operations
  3. Captcha Respect: Stop automation if captcha appears
  4. Quality Edits: Only make edits that genuinely improve content
  5. No Spam: Avoid repetitive or low-quality actions
  6. Transparency: Consider disclosing bot usage where appropriate

Legal Notice

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.

Development Status

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.

Contributing

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.

Author

License

This application has an MIT license - see the LICENSE file for details.

About

A Node.js automation tool for Stack Overflow that performs automated voting, spell-checking, and post editing. Built in 2021 as an educational project to explore web automation and content quality improvement on Stack Overflow.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors