# 🔐 Super Easy Properstar Login Guide

## 🎯 Three Ways to Login (Pick the Easiest for You!)

---

### ⭐ **Option 1: Double-Click (Easiest!)**

1. **Find this file** in Finder:
   ```
   Login to Properstar.command
   ```

2. **Double-click it**
   - Terminal opens automatically
   - Browser opens to Properstar

3. **Log in to Properstar**
   - You have 3 full minutes
   - Countdown shows in terminal

4. **Done!**
   - Session saves automatically
   - Everything works forever (until session expires)

---

### 🚀 **Option 2: Simple Shell Script**

```bash
./login.sh
```

**That's it!** Just run this one command.

---

### 💻 **Option 3: Original Command (Still Works)**

```bash
python3 timed_login.py
```

Same as before, but the other options are easier!

---

## 📍 Location

All these files are in:
```
/Users/jonathan/SynologyDrive/Since Today/PROJECTEN/farmmatch/scraper/
```

**In Finder:**
1. Go to `SynologyDrive`
2. Open `Since Today`
3. Open `PROJECTEN`
4. Open `farmmatch`
5. Open `scraper`
6. **Double-click** "Login to Properstar.command"

---

## ⏱️ What Happens

```
1. File opens terminal
2. Browser opens to Properstar
3. Timer starts (3 minutes)

   ⏳ Countdown shows:
   ⏳ 3:00 remaining...
   ⏳ 2:30 remaining...
   ⏳ 2:00 remaining...

4. You log in to Properstar
5. Navigate to favorites

6. After 3 minutes:
   ✅ Session saved to auth.json!

7. Done forever! 🎉
```

---

## 🎉 After Login (One Time Only)

**Everything works automatically:**

✅ **UI Button** - Click "Full Update" in browser
✅ **Command Line** - Run `python3 auto_scrape_favorites.py now`
✅ **Scheduled Jobs** - Set it and forget it

**No more manual login needed!** (Until session expires in weeks/months)

---

## 🔄 If Session Expires Later

Just double-click "Login to Properstar.command" again!

**Signs your session expired:**
- Scraper says "Sessie verlopen"
- Browser opens but immediately fails
- "Authentication error" in logs

**Solution:**
```bash
rm auth.json
./login.sh
```

Or just double-click "Login to Properstar.command"

---

## 🆘 Troubleshooting

### "Permission denied"
```bash
chmod +x login.sh
chmod +x "Login to Properstar.command"
```

### "Command not found"
Make sure you're in the scraper directory:
```bash
cd /Users/jonathan/SynologyDrive/Since\ Today/PROJECTEN/farmmatch/scraper
```

### "Browser doesn't open"
Check Playwright is installed:
```bash
pip3 install playwright
playwright install
```

### "Session doesn't save"
Make sure you:
1. Actually logged in to Properstar
2. Navigated to favorites page
3. Waited the full 3 minutes

---

## 💡 Pro Tips

**First Time Setup:**
1. Double-click "Login to Properstar.command"
2. Log in when browser opens
3. Wait 3 minutes
4. ✅ Done! Never do this again

**Quick Test:**
After logging in, run:
```bash
python3 test_update_pipeline.py
```

Should show 9/9 tests passing!

---

## 📋 Summary

| Method | Command | Difficulty |
|--------|---------|------------|
| **Double-Click** | (Just double-click the file) | ⭐ Easiest |
| **Shell Script** | `./login.sh` | ⭐⭐ Easy |
| **Original** | `python3 timed_login.py` | ⭐⭐⭐ Medium |

**Recommendation:** Just double-click "Login to Properstar.command"!

It's as easy as opening any app on your Mac.

---

🎉 **You're all set!** The login process is now as simple as double-clicking a file.
