# Clawdis Allegro Skill

A [Clawdis](https://github.com/steipete/clawdis) skill for monitoring prices on [Allegro.pl](https://allegro.pl) — Poland's largest e-commerce platform.

## Why?

Allegro's API registration is currently closed to new applications. This skill uses browser automation to scrape search results, making it possible to:

- Track prices on specific items (GPUs, electronics, etc.)
- Set up automated price alerts via cron
- Get notified when items drop below your threshold

## Installation

Copy the `allegro-monitor` folder to your Clawdis skills directory:

```bash
cp -r allegro-monitor /path/to/your/clawd/skills/
```

Or clone directly:

```bash
cd /path/to/your/clawd/skills
git clone https://github.com/nexty5870/clawdis-allegro-skill.git allegro-monitor
```

## Requirements

- [Clawdis](https://github.com/steipete/clawdis) with browser automation enabled (`clawdis_browser`)
- Node.js 18+

## Usage

The skill is designed to be used by the Clawdis agent via natural language. Just ask:

> "Check Allegro for RTX 3090 prices"

> "Find me a used RTX 3090 under 3000 PLN"

> "Monitor Allegro for PS5 deals"

### How It Works

1. Opens Allegro search page with your query
2. Accepts cookie consent if needed
3. Sorts results by price (lowest first)
4. Extracts: title, price, condition, seller type, URL
5. Filters by your criteria (price, condition)
6. Returns structured results

### Condition Filters

Polish conditions and their meanings:
- `Nowy` — New
- `Jak nowe` — Like new
- `Używany` — Used (working)
- `Powystawowy` — Ex-display
- `Uszkodzony` — Damaged (non-working)

## Automated Monitoring (Cron)

Set up a daily price check with Clawdis cron:

```json
{
  "name": "RTX 3090 Price Monitor",
  "schedule": { "kind": "cron", "expr": "0 9,14,19 * * *", "tz": "Europe/Warsaw" },
  "sessionTarget": "isolated",
  "wakeMode": "now",
  "payload": {
    "kind": "agentTurn",
    "message": "Check Allegro for RTX 3090. Look for WORKING cards only (Używany, Jak nowe - NOT Uszkodzony). If any under 2900 PLN, alert me with details.",
    "deliver": false
  }
}
```

This checks 3x daily (9:00, 14:00, 19:00) and only alerts you when there's a deal.

## Example Output

When the agent finds listings, you'll get something like:

```
🎮 RTX 3090 Deal Alert!

Found a working RTX 3090 under your 2900 PLN threshold:

💰 2,800 PLN - ZOTAC Gaming Trinity OC RTX 3090 24GB
- Condition: Używany (Used - working)
- Seller: Private
- 🔗 https://allegro.pl/oferta/...

Next cheapest working card: 3,148 PLN (348 PLN more)
```

## Limitations

- Uses browser automation — requires a running browser instance
- Allegro may change their page structure (scraping is fragile)
- Cookie consent popup needs to be handled on first visit
- Rate limiting: don't check too frequently or you may get blocked

## License

MIT

## Credits

Built for [Clawdis](https://github.com/steipete/clawdis) by the community.
