Monitors

Monitors

A suite of purpose-built web scrapers powering the Proxcop and Pokecop alert networks. Each monitor runs an independent fetch → diff → notify → persist loop tailored to its target site. Go monitors handle Shopify products.json polling (detecting new products, new variants, and restocks) and sitemap monitoring (Chrome Hearts). Python handles JS-rendered targets requiring browser emulation and fingerprint bypass. Node.js integrates with platform APIs. All monitors use exponential backoff, disk-persisted state to prevent duplicate notifications, heartbeat pings for liveness verification, and PM2 for production process management.

Overview

The Monitors are a suite of specialized web scraping processes that form the intelligence engine behind the Proxcop and Pokecop communities. Each monitor is purpose-built for a specific target website, handling the unique page structure, anti-bot measures, and data extraction patterns of that site. When stock appears or changes, monitors fire Discord webhook notifications to community members within seconds.

The system spans multiple languages — Go for high-performance polling monitors, Python for sites requiring browser emulation or advanced fingerprinting bypass, and Node.js for API-integrated monitors. All monitors share the same core loop: fetch → diff against known state → notify on change → persist new state.

Reliability engineering is a first-class concern: exponential backoff on network failures, heartbeat pings to verify liveness, state persistence to disk to survive restarts without duplicate notifications, and PM2 process management for production uptime.

Screenshots

Discord notification — new drop
Discord notification — restock
PM2 process list — production

Monitor Types

Go

Shopify Monitor

Polls any Shopify store's public products.json endpoint and diffs it against persisted state to detect three event types: new products, new size variants, and restocks (variant going from unavailable → available). On first boot, state is silently initialized so existing products don't trigger false positives.

DetectsNew product · New variant · Restock
ConfigSHOPIFY_URL, DISCORD_WEBHOOK_URL, INTERVAL_SECONDS, STATE_FILE
ResilienceExponential backoff on errors (capped at 5 min), webhook URL normalization
ProductionEach store runs as a separate PM2 process with its own .env
Go

Chrome Hearts Monitor

Monitors the Chrome Hearts website sitemap for new product page URLs and redirect changes. A 302 redirect on a known URL signals a stock drop or availability change. The monitor differentiates between 301 permanent redirects (ignored) and 302 temporary redirects (notified). Optional keyword filtering limits alerts to relevant products.

DetectsNew sitemap URLs · 302 redirects (stock drops)
ConfigWEBHOOK_URLS (comma-sep), KEYWORDS, POLL_INTERVAL
ResilienceExponential backoff, heartbeat notifications, skip cycle on transient errors
StateJSON file persists seen URLs and redirect destinations across restarts
Go

Affluence Backend Monitor

A generic monitor that polls the MonitorManager backend API to fetch configured products for one or more websites, then scrapes each product according to its configuration. Supports multiple sites in a single process run. Results are dispatched to per-product webhook URLs.

ConfigWEBSITE_NAME, COOK_GROUP, PRIVATE_KEY, API_BASE_URL
IntegrationReads product config from MonitorManager API — no hardcoded product lists
Multi-siteComma-separated WEBSITE_NAME supports monitoring multiple sites in one process
PythonNode.js

Extended Monitor Fleet

Beyond the Go monitors, the system includes a fleet of Python and Node.js monitors targeting sites with more complex anti-bot defenses — browser fingerprint challenges, CAPTCHA, JS-rendered content, and session-based rate limiting. Python handles scraping logic requiring Selenium or Playwright for headless browser emulation. Node.js monitors integrate directly with platform APIs where available (Shopify Storefront API, brand webhook feeds).

Python targetsJS-heavy sites, fingerprint bypass, session management, CAPTCHA handling
Node.js targetsAPI-integrated monitors, Storefront API polling, webhook ingestion

Core Loop

1

Fetch

HTTP request to the target endpoint (products.json, sitemap, API). Headers mimic legitimate browser traffic. Retry with exponential backoff on network failures.

2

Diff

Compare fetched data against state persisted to disk from the last cycle. New product IDs, new variant IDs, or availability changes trigger notifications.

3

Notify

Build a rich Discord embed with product name, image, URL, variant details, and price. POST to all configured webhook URLs for that product.

4

Persist

Write new state to the JSON state file. On the next cycle, this becomes the baseline for diffing. Restart-safe — no duplicate notifications after a process restart.

5

Sleep

Wait for the configured interval (typically 10–60 seconds) before the next cycle. Interval tuned per target to balance freshness against rate limiting risk.

Tech Stack

GoPrimary language for polling monitors — goroutines for concurrent requests, minimal dependencies, single-binary deployment
PythonBrowser automation monitors using Playwright/Selenium for JS-rendered targets and fingerprint bypass
Node.jsAPI-integrated monitors and notification pipeline integration with MonitorManager backend
Discord WebhooksRich embed notifications with product images, variant details, and direct purchase links
PM2Production process manager — auto-restart on crash, per-process .env files, log rotation
JSON State FilesDisk-persisted state ensures no duplicate notifications across process restarts or deployments