mirror of
https://github.com/skidoodle/ncore-stats.git
synced 2026-04-28 15:57:37 +02:00
Update readme.md
This commit is contained in:
@@ -1,52 +1,57 @@
|
|||||||
# nCore Profile Tracker
|
# nCore Profile Tracker
|
||||||
|
|
||||||
A simple Go project to scrape and track profile statistics (rank, upload, download, points) on nCore, the largest Hungarian BitTorrent tracker. The stats are displayed on a basic web interface and saved as JSON for historical tracking.
|
A simple Go project to scrape and track profile statistics (rank, upload, download, points) on nCore, the largest Hungarian BitTorrent tracker. The stats are stored in a SQLite database and displayed on a basic web interface.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Scrapes and logs profile stats from nCore.
|
- Scrapes and logs profile stats from nCore for multiple users.
|
||||||
- Serves a simple HTML dashboard to display the latest data.
|
- Serves a simple HTML dashboard to display the latest data and historical charts.
|
||||||
- Provides a JSON API to fetch historical profile data.
|
- Provides a JSON API to fetch historical profile data.
|
||||||
- Automatically updates data every 24 hours.
|
- Stores all data persistently in a SQLite database.
|
||||||
|
- Automatically updates data every 24 hours.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
1. Clone the repo:
|
1. **Clone the repo:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/skidoodle/ncore-stats.git
|
git clone https://github.com/skidoodle/ncore-stats
|
||||||
cd ncore-stats
|
cd ncore-stats
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Create a `.env` file with your nCore credentials:
|
2. **Create a `.env` file with your nCore credentials:**
|
||||||
|
|
||||||
```bash
|
```ini
|
||||||
NICK=your_nick
|
NICK=your_nick
|
||||||
PASS=your_password
|
PASS=your_password
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Add the `profiles.json` file, which contains your profile IDs:
|
3. **Add Users to Track**
|
||||||
|
|
||||||
```json
|
You can add users via the `--add-user` command-line flag. Run this command for each user you want to track.
|
||||||
{
|
|
||||||
"alice": "69",
|
The format is a single string: `'DisplayName,ProfileID'`.
|
||||||
"bob": "420"
|
|
||||||
}
|
```bash
|
||||||
|
# Example for running from source
|
||||||
|
go run . --add-user 'Alice,69'
|
||||||
|
go run . --add-user 'Bob,420'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **How to find a Profile ID?**
|
||||||
|
> Navigate to a user's profile on nCore. The URL will be `https://ncore.pro/profile.php?id=12345`. The `ProfileID` is the number at the end.
|
||||||
|
|
||||||
### How to obtain `NICK` and `PASS`
|
### How to obtain `NICK` and `PASS`
|
||||||
|
|
||||||
- Open the developer tools in your browser (F12), go to the "Network" tab.
|
- Open the developer tools in your browser (F12), go to the "Network" tab.
|
||||||
- Log in using "lower security" mode.
|
- Log in to nCore using "lower security" mode.
|
||||||
- Find the `login.php` request in the network activity.
|
- Find the `login.php` request in the network activity.
|
||||||
- In the response headers, locate the `Set-Cookie` header, which will contain `nick=` and `pass=` values.
|
- In the response headers, locate the `Set-Cookie` header, which will contain `nick=` and `pass=` values.
|
||||||
- Copy those values and add them to your `.env` file.
|
- Copy those values and add them to your `.env` file.
|
||||||
|
|
||||||
## Running with Docker Compose
|
## Running with Docker Compose
|
||||||
|
|
||||||
To deploy the project using Docker Compose:
|
1. **Create the following `docker-compose.yml` file:**
|
||||||
|
|
||||||
1. Create the following `docker-compose.yml` file:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
@@ -57,24 +62,43 @@ To deploy the project using Docker Compose:
|
|||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- data:/app/data
|
- ./data:/app/data
|
||||||
|
environment:
|
||||||
volumes:
|
- NICK=
|
||||||
data:
|
- PASS=
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Run the Docker Compose setup:
|
2. **Add Users using Docker**
|
||||||
|
|
||||||
|
Before starting the service, or to add new users later, run the `--add-user` command inside a temporary container. This ensures the user is added to the database in your persistent volume.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
# Use 'docker compose run' to add users before starting
|
||||||
|
docker compose run --rm ncore-stats --add-user 'Alice,69'
|
||||||
|
docker compose run --rm ncore-stats --add-user 'Bob,420'
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Open `:3000` to view your stats.
|
If the container is already running, you can use `docker exec`:
|
||||||
|
```bash
|
||||||
|
# The executable inside the container is named 'trackncore'
|
||||||
|
docker exec ncore-stats ./trackncore --add-user 'Charlie,1337'
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Run the Docker Compose setup:**
|
||||||
|
|
||||||
|
Once you have added your users, start the service.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Open `http://localhost:3000` to view your stats.
|
||||||
|
|
||||||
### Updating
|
### Updating
|
||||||
|
|
||||||
To pull the latest image and restart the service:
|
To pull the latest image and restart the service:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose pull
|
docker compose pull
|
||||||
docker-compose up -d
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user