How charlesbel/microsoft-rewards-farmer works
Project type and purpose
• Type: A command-line, open-source automation tool (bot) written in Python.
• Purpose: Automate Microsoft Rewards tasks (searches, daily sets, punch cards, promotions), support multi-account management, proxies, notifications, and auto-updates via Selenium.
File structure
• Entry points:
• main.py – primary orchestrator
• autoupdate_main.py – wraps main.py with self-update logic
• src/ – core modules:
• browser.py – sets up Selenium WebDriver
• login.py – handles authentication (including 2FA)
• searches.py, dailySet.py, punchCards.py, morePromotions.py, activities.py – implement individual task flows
• notifier.py – dispatches Discord/Telegram notifications
• userAgentGenerator.py, constants.py, utils.py, loggingColoredFormatter.py – supporting utilities
• accounts.json.sample – credentials template
• requirements.txt – dependency list (selenium, requests, etc.)
README for architectural insights
• The tool relies on Selenium (with WebDriver Manager).
• Supports CLI flags for headless mode, language, geo, proxy, notifications.
• Session storing indicates persistence of cookies or session state between runs.
• Auto-update checks a repo, downloads a new version, then executes.
a. Main components
• CLI Interface (main.py / autoupdate_main.py)
• Configuration Loader (accounts.json + CLI args parser)
• Session Manager (session storage on disk)
• Selenium Controller (browser.py + WebDriver Manager)
• Task Modules (searches, dailySet, punchCards, morePromotions, activities)
• Notification Module (notifier.py)
• Auto-Updater (autoupdate_main.py logic)
• External Services:
– Microsoft Rewards web endpoints
– Discord Webhook API
– Telegram Bot API
– GitHub (for updates)
b. Relationships & interactions
1. CLI → Configuration Loader reads accounts.json & flags.
2. CLI/autoupdate_main → Auto-Updater (if enabled) → may restart the tool.
3. Main orchestrator instantiates Session Manager & Selenium Controller.
4. Selenium Controller launches Chrome, loads cookies or logs in via login module.
5. Main orchestrator sequentially invokes Task Modules. Each:
– Uses Selenium Controller to navigate & perform UI actions.
– Reports status to Notification Module.
6. After tasks complete, Notification Module posts to Discord/Telegram.
7. Session Manager persists cookies/session for next run.
c. Architectural patterns / design principles
• Modular decomposition: each feature in its own module.
• Single Responsibility: browser setup, login, each task, and notifications are separate.
• Orchestration Layer: main.py controls the overall flow.
• Self-updating: bootstrap wrapper for version management.
• Config-driven: JSON + CLI arguments.
d. Key technologies / frameworks
• Python 3.x
• Selenium with webdriver-manager
• requests (for notifications)
• argparse or click (CLI parsing)
• JSON for config
Elements
• CLI → Config Loader, Auto-Updater, Session Manager, Selenium Controller
• Selenium Controller ↔ Microsoft Rewards
• Task Modules → Selenium Controller
• Task Modules → Notification Module → (Discord API, Telegram API)
• Auto-Updater → GitHub → restart flow
• Session Manager → local disk
• Arrowheads – data/control flow direction