$ show githubdulong/Script
This repository is a personal collection of JavaScript scripts primarily targeting iOS proxy tools (Surge, Quantumult X, Loon), Scriptable widgets, and various automation utilities. It serves as an aggregated library of community-sourced and original scripts for ad blocking, premium service unlocking, network status panels, cloud drive mounting (Aliyun, Quark, PikPak via Fileball), automated check-ins (WPS, TestFlight, JD), and JD shopping assistants (price history, rebate links). The codebase is heavily oriented towards proxy tool environments, with scripts modifying HTTP responses and leveraging environment abstractions (Env class) for cross-platform compatibility. A smaller but significant portion consists of Scriptable home screen widgets (weather, GitHub, Weibo, JD balances, cryptocurrency prices) and a standalone IPA downloader tool. While the repository demonstrates practical utility and some well-crafted reusable patterns (e.g., DmYY widget base class, AppleStoreAPI), overall quality is diluted by duplicated functionality, hardcoded API keys, fragile regex patterns, and lack of versioning or tests. It is best suited for users already immersed in the Surge/Quantumult X ecosystem who need ready-made scripts for common tasks.
The LLM identified 4 files worth highlighting for reuse:
A reusable base class for Scriptable widgets, providing HTTP requests, file caching, settings management with a WebView-based configuration UI, background image handling, and responsive layout. Used by multiple widgets (PriceWidgets, JD-in-one-v2, ChinaTelecom_Multi). Demonstrates non-obvious craftsmanship in caching strategies, iCloud sync, and adaptive UI design. Could be extracted to bootstrap new Scriptable widgets with minimal adaptation.
A comprehensive Apple Store API client that handles login, app search, version listing, and purchase/redownload. Includes an LRU cache for version data, Express-like HTTP routing, and robust error handling. Self-contained and well-structured, it could be reused in any Node.js or proxy script context requiring Apple Store integration.
A full-featured IPA downloader app with a custom global state management system (createGlobalState) using Proxy for precise updates and persistence, an EventBus for inter-module communication, and a robust download manager supporting pause/resume/queue. The state management pattern and download manager are self-contained and could be extracted into separate libraries for other scripting projects.
A unique script that monitors download speed and dynamically switches Surge proxy policies to maximize throughput. Uses timing-based speed calculation and threshold logic to avoid throttling. Demonstrates non-obvious skill in network monitoring and policy automation, and can be adapted to other proxy tools with minimal changes.