- Document agent guidelines for asset tracking, including build commands, code style, data conventions, and security practices. - Document project setup, features, configuration, usage, and output details for an asset tracking tool.
2.2 KiB
2.2 KiB
Asset Tracker
A Bash-based tool for tracking user assets and generating visualizations from the Prismatic Imperium game platform.
Overview
This project extracts asset data from user profiles, stores it in CSV format, and generates time-series charts showing total assets and diamonds on hand over time.
Features
- Automated data extraction from Prismatic Imperium user pages
- CSV data storage with timestamps
- Chart generation in ASCII and PNG formats
- Multiple user support with configurable user IDs
- Automatic deployment to web server via SSH
Prerequisites
- Bash shell
- curl for web requests
- gnuplot for chart generation
- SSH access to web server (for deployment)
Installation
- Clone or download the scripts to your desired location
- Make scripts executable:
chmod +x extract_assets.sh chart_asset_data.sh run_with_agent.sh - Configure user IDs in
user_ids.conf
Configuration
Edit user_ids.conf to specify which user IDs to track:
USER_IDS=("667" "31" "744" "602" "268")
Usage
Run Full Pipeline (Recommended)
./run_with_agent.sh
This script:
- Sets up SSH agent
- Adds SSH key for deployment
- Runs data extraction
- Generates charts
- Deploys to web server
Individual Steps
Extract asset data:
./extract_assets.sh
Generate charts:
./chart_asset_data.sh
Output Files
CSV Data
assets_data_{USER_ID}.csv- Time-series asset data- Format:
date,rank,diamonds,total_assets
Charts
total_assets_{USER_ID}.png- Total assets over timediamonds_on_hand_{USER_ID}.png- Diamonds on hand over time
Charts are generated with:
- Black background
- Orange (#FE6A00) for total assets
- Teal (#2CB9CF) for diamonds
- White grid lines and labels
Deployment
Charts are automatically copied to the web server at:
/var/www/erictaylor/img/asset_tracker/
Data Processing
The tool extracts numeric values from web pages, removes commas, and stores them with timestamps. Gnuplot processes the data to create visualizations with configurable date formatting and axis styling.
Security
- Uses SSH agent for key management
- Configuration files isolate sensitive paths
- File existence validation before processing