# Malawi Jobs Bot
Scrapes a list of Malawi job sites, keeps only recent postings, scores
them against your CV keywords, and sends you a Telegram digest of
anything worth applying to.
## 1. Install
```bash
cd malawi-jobs-bot
python -m venv venv
venv\Scripts\activate # Mac/Linux: source venv/bin/activate
pip install -r requirements.txt
```
## 2. Set up your secrets
Secrets (Telegram token + chat id) live in `local_settings.py`, which is
**gitignored** and never committed. Create it from the template:
```bash
Copy-Item local_settings.example.py local_settings.py # Mac/Linux: cp
```
Then open `local_settings.py` and fill in:
```python
TELEGRAM_BOT_TOKEN = "your-real-token"
TELEGRAM_CHAT_ID = "your-real-chat-id"
```
**Getting the token:** message **@BotFather** on Telegram → `/newbot` →
follow the prompts → copy the token it gives you.
**Getting the chat id:** send your new bot any message (e.g. "hi"), then
run this from the project folder:
```bash
python -c "import requests; from config import TELEGRAM_BOT_TOKEN; print(requests.get(f'
api.telegram.org').text)"
```
Look for `"chat":{"id": ...}` in the output — that number is your chat id.
Until `local_settings.py` exists, the script just prints the digest to
your terminal instead, so you can test everything else first.
## 3. Add your CV keywords
Edit `CV_KEYWORDS` in `config.py` — job titles you've held, core skills,
sectors you want. Add anything you don't want to `EXCLUDE_KEYWORDS`.
Matching is whole-word, so short keywords like `"IT"` won't accidentally
match inside unrelated words.
## 4. Fix site selectors as needed
`config.py` lists 9 Malawi job sites. Some scrape correctly out of the
box; others need their CSS selectors adjusted because I couldn't verify
them against live pages while building this. To check what's working:
```bash
python debug_titles.py
```
This prints every job title found per site with its match score, so you
can see at a gl …