- 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.
97 lines
2.2 KiB
Markdown
97 lines
2.2 KiB
Markdown
# 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
|
|
|
|
1. Clone or download the scripts to your desired location
|
|
2. Make scripts executable:
|
|
```bash
|
|
chmod +x extract_assets.sh chart_asset_data.sh run_with_agent.sh
|
|
```
|
|
3. Configure user IDs in `user_ids.conf`
|
|
|
|
## Configuration
|
|
|
|
Edit `user_ids.conf` to specify which user IDs to track:
|
|
|
|
```bash
|
|
USER_IDS=("667" "31" "744" "602" "268")
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Run Full Pipeline (Recommended)
|
|
|
|
```bash
|
|
./run_with_agent.sh
|
|
```
|
|
|
|
This script:
|
|
1. Sets up SSH agent
|
|
2. Adds SSH key for deployment
|
|
3. Runs data extraction
|
|
4. Generates charts
|
|
5. Deploys to web server
|
|
|
|
### Individual Steps
|
|
|
|
**Extract asset data:**
|
|
```bash
|
|
./extract_assets.sh
|
|
```
|
|
|
|
**Generate charts:**
|
|
```bash
|
|
./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 time
|
|
- `diamonds_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 |