How agluo/ql-script-hub works
Project Type and Purpose
• QL Script Hub is not a web app or microservice suite but a scheduler-driven automation toolkit.
• It lives inside the QingLong 面板 (a Node.js-based cron scheduler) and provides a library of standalone Python scripts for “签到” (check-in) and “薅羊毛” (coupon-hunting) tasks against various target websites.
File‐Structure Analysis
• Top‐level: a flat list of .py scripts, each named after a target (e.g., aliyunpan_checkin.py, enshan_checkin.py).
• archive/: older or deprecated scripts.
• No frontend, no database, no shared library code—each script is self-contained.
• Configuration is 100% via environment variables (set in QingLong).
README Insights
• Key components: QingLong 面板 (scheduler), Python 运行时, environment-vars (cookies, tokens), external target sites (Alipay, NGA, Tieba, etc.), and notification endpoints (Telegram, Server酱, Push+).
• Usage pattern: subscribe repo in QingLong → set env vars → scripts run on cron → notifications on each run.
a. Main Components
• QingLong 面板 (Cron Scheduler on Node.js)
• Python Runtime Environment (hosted on the same server as QingLong)
• Script Modules (one per .py file)
• Environment‐Variable Store (within QingLong)
• External Target Websites (各大论坛/网盘)
• Notification Services (Telegram Bot, Server酱, Push+, DingTalk, Bark)
b. Relationships & Interactions
• Scheduler → launches Python interpreter → loads specific script module
• Script → reads its required env vars → makes HTTP(S) requests to target website → parses response
• Script → on success/failure → posts message to selected notification service via its API → user receives notification
c. Architectural Patterns & Principles
• Modular/Plugin Architecture: each script acts as an independent plugin with a uniform interface (read config, perform task, emit result).
• Centralized Configuration: environment variables decouple code from credentials.
• Single Responsibility: each script handles exactly one target site.
• Cron‐Driven Event Loop: no persistent servers or message queues—purely scheduled runs.
d. Key Technologies & Frameworks
• QingLong 面板 (Node.js, Express, Cron)
• Python 3.x (requests, json, os.environ)
• External HTTP APIs (web scraping or official REST endpoints)
• Notification APIs (Telegram Bot API, Server酱 HTTP, Push+ HTTP, DingTalk Robot webhook, Bark)