How 92gthrbg88-eng/faction-stat-logger works
This single-file Torn userscript detects profile pages, reads a stored API key, fetches profile statistics, and displays them in a persistent panel; when live data is unavailable, it falls back to battle history. The sampled excerpts show the page observer refreshing the panel and the live-fetch failure path invoking the fallback. Internal details of the fallback request are partly omitted, so its API connection is shown as documented rather than inferred from an unseen call.
Main entry points: faction-stat-logger.user.js Profile data fetch
Components 7
Other components
- Torn profile page
- Userscript runtime
faction-stat-logger.user.js - API key settings
faction-stat-logger.user.js - Profile data fetch
faction-stat-logger.user.js - Battle history fallback
faction-stat-logger.user.js - Torn API
- Faction intel panel
faction-stat-logger.user.js
Connections 8
- Torn profile page → Userscript runtime: matches page
faction-stat-logger.user.js - Userscript runtime → API key settings: reads key
faction-stat-logger.user.js - Userscript runtime → Faction intel panel: refreshes panel
faction-stat-logger.user.js - Profile data fetch → Torn API: fetches profile
faction-stat-logger.user.js - Profile data fetch → Battle history fallback: falls back
faction-stat-logger.user.js - Battle history fallback → Torn API: requests history
- Profile data fetch → Faction intel panel: writes stats
faction-stat-logger.user.js - Battle history fallback → Faction intel panel: writes fallback
faction-stat-logger.user.js