{"id":38137145,"url":"https://github.com/milad-rasouli/jaabz","last_synced_at":"2026-01-16T22:42:37.612Z","repository":{"id":293492112,"uuid":"984129682","full_name":"milad-rasouli/jaabz","owner":"milad-rasouli","description":"jaabs telegram poster","archived":false,"fork":false,"pushed_at":"2025-05-15T15:43:34.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T16:40:01.602Z","etag":null,"topics":["golang","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milad-rasouli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-15T12:48:54.000Z","updated_at":"2025-05-15T15:43:38.000Z","dependencies_parsed_at":"2025-05-15T16:51:09.723Z","dependency_job_id":null,"html_url":"https://github.com/milad-rasouli/jaabz","commit_stats":null,"previous_names":["milad-rasouli/jaabz"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/milad-rasouli/jaabz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milad-rasouli%2Fjaabz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milad-rasouli%2Fjaabz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milad-rasouli%2Fjaabz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milad-rasouli%2Fjaabz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milad-rasouli","download_url":"https://codeload.github.com/milad-rasouli/jaabz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milad-rasouli%2Fjaabz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28485718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","telegram","telegram-bot"],"created_at":"2026-01-16T22:42:36.873Z","updated_at":"2026-01-16T22:42:37.604Z","avatar_url":"https://github.com/milad-rasouli.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jaabz Job Scraper\n\nJaabz Job Scraper is a Go application that periodically fetches job listings from [Jaabz](https://jaabz.com), checks for duplicates using Redis, and posts non-duplicate jobs to a Telegram channel. The application runs in a Dockerized environment with Redis for persistence and uses the Telegram Bot API for notifications.\n\n## Table of Contents\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Setup](#setup)\n    - [Clone the Repository](#clone-the-repository)\n    - [Configure Environment Variables](#configure-environment-variables)\n    - [Build and Run with Docker](#build-and-run-with-docker)\n    - [Run Locally (Optional)](#run-locally-optional)\n- [Usage](#usage)\n- [Directory Structure](#directory-structure)\n- [Environment Variables](#environment-variables)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n- Fetches job listings from Jaabz every 60 seconds.\n- Uses Redis to track and skip duplicate jobs based on their visit links.\n- Posts non-duplicate jobs to a Telegram channel with formatted details (title, company, work status, location, skills, apply link).\n- Batches multiple jobs into a single Telegram message to reduce API calls and respect rate limits.\n- Handles Telegram rate limits with retries and delays.\n- Runs in a Dockerized environment for easy deployment.\n- Comprehensive logging for debugging and monitoring.\n\n## Prerequisites\n- [Docker](https://www.docker.com/get-started) and [Docker Compose](https://docs.docker.com/compose/install/) installed.\n- A Telegram bot token from [@BotFather](https://t.me/BotFather).\n- A Telegram channel (public or private) where the bot is an admin with **Post Messages** permission.\n- Redis (provided via Docker) for duplicate checking.\n- Go 1.22 or later (if running locally without Docker).\n\n## Setup\n\n### Clone the Repository\n```bash\ngit clone https://github.com/milad-rasouli/jaabz.git\ncd jaabz\n```\n\n### Configure Environment Variables\n1. Copy the example environment file:\n   ```bash\n   cp env.example .env\n   ```\n2. Edit `.env` with your configuration:\n   ```env\n   APP_NAME=jaabz\n   ENVIRONMENT=development\n   JAABZ_HOST=https://jaabz.com/jobs?job_state=\u0026keyword=golang\u0026category=\u0026skill=\u0026country=\n   REDIS_HOST=jaabz-redis:6379\n   TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11\n   TELEGRAM_CHANNEL_ID=@JaabzJobs\n   ```\n    - **APP_NAME**: Application name (default: `jaabz`).\n    - **ENVIRONMENT**: Environment (e.g., `development`, `production`).\n    - **JAABZ_HOST**: URL for fetching Jaabz jobs (update query parameters as needed).\n    - **REDIS_HOST**: Redis host and port (use `jaabz-redis:6379` for Docker).\n    - **TELEGRAM_BOT_TOKEN**: Obtain from [@BotFather](#obtaining-a-telegram-bot-token).\n    - **TELEGRAM_CHANNEL_ID**: Channel handle (e.g., `@JaabzJobs`) or private ID (e.g., `-1001234567890`).\n\n3. **Obtaining a Telegram Bot Token**:\n    - Message `@BotFather` on Telegram.\n    - Send `/newbot`, set a name (e.g., `Jaabz Job Bot`) and username (e.g., `@JaabzJobBot`).\n    - Copy the provided token (e.g., `123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11`).\n\n4. **Setting Up the Telegram Channel**:\n    - Create a public channel (e.g., `@JaabzJobs`) or private channel.\n    - For private channels, get the ID by forwarding a message to `@GetIDsBot`.\n    - Add the bot as an admin:\n        - Channel settings \u003e **Administrators** \u003e **Add Administrator** \u003e `@JaabzJobBot` \u003e Grant **Post Messages** permission.\n\n### Build and Run with Docker\n1. Build and start the services:\n   ```bash\n   docker-compose up -d --build\n   ```\n    - This starts the `jaabz-app` (Go application) and `jaabz-redis` (Redis) containers.\n    - The application is built from the `Dockerfile` and runs the compiled binary at `/app/build`.\n\n2. View logs:\n   ```bash\n   docker logs jaabz-app\n   ```\n    - Look for:\n      ```\n      time=2025-05-15T15:03:06.602Z level=INFO msg=\"Telegram bot initialized\" package=telegram bot_username=@JaabzJobBot\n      time=2025-05-15T15:03:06.603Z level=INFO msg=\"Fetched jobs\" service=jaabz method=processJobs count=3\n      time=2025-05-15T15:03:06.605Z level=DEBUG msg=\"Posted batch of jobs to Telegram\" service=jaabz method=processJobs job_count=2\n      ```\n\n3. Stop the services:\n   ```bash\n   docker-compose down\n   ```\n\n### Run Locally (Optional)\n1. Install Go dependencies:\n   ```bash\n   go mod download\n   ```\n2. Update `.env` to use local Redis:\n   ```env\n   REDIS_HOST=localhost:6379\n   ```\n3. Run Redis locally (if not using Docker):\n   ```bash\n   docker run -d --name redis -p 6379:6379 redis:8.0-M02-alpine\n   ```\n4. Build and run:\n   ```bash\n   make run\n   ```\n    - The `Makefile` builds the binary to `bin/jaabz` and runs it.\n\n## Usage\n- The application fetches jobs from `JAABZ_HOST` every 60 seconds.\n- It checks for duplicates using Redis (based on job visit links).\n- Non-duplicate jobs are batched into a single Telegram message (up to 4096 characters) and posted to the specified channel.\n- Example Telegram post:\n  ```\n  *New Job Postings*\n\n  *Title*: MongoDB Database Administrator\n  *Company*: Tech Corp\n  *Work Status*: Remote\n  *Location*: Remote\n  *Skills*: MongoDB, Linux\n  *Apply*: [Link](https://jaabz.com/jobs/81287-mongodb-database-administrator)\n\n  *Title*: Software Engineer\n  *Company*: InnoSoft\n  *Work Status*: Full-time\n  *Location*: San Francisco\n  *Skills*: Go, Docker\n  *Apply*: [Link](https://jaabz.com/jobs/81217-software-engineer)\n  ```\n- Rate limits are handled with retries (up to 3 attempts) and delays based on Telegram’s `retry_after` response.\n\n## Directory Structure\n```\njaabz/\n├── bin/                    # Compiled binaries\n├── cmd/                    # Main application entry point\n│   └── main.go\n├── docker-compose.yml      # Docker Compose configuration\n├── Dockerfile              # Docker build instructions\n├── env.example             # Example environment file\n├── go.mod                  # Go module dependencies\n├── go.sum                  # Go dependency checksums\n├── internal/               # Internal packages\n│   ├── infra/              # Infrastructure (e.g., godotenv, redis)\n│   ├── repo/               # Repositories (e.g., telegram, jaabz, duplicate)\n│   └── service/            # Business logic\n├── Makefile                # Build and run commands\n└── README.md               # Project documentation\n```\n\n## Environment Variables\n| Variable             | Description                                      | Example                                      |\n|----------------------|--------------------------------------------------|----------------------------------------------|\n| `APP_NAME`           | Application name                                 | `jaabz`                                      |\n| `ENVIRONMENT`        | Environment (e.g., development, production)       | `development`                                |\n| `JAABZ_HOST`         | URL for fetching Jaabz jobs                      | `https://jaabz.com/jobs?...`                 |\n| `REDIS_HOST`         | Redis host and port                              | `jaabz-redis:6379` (Docker) or `localhost:6379` |\n| `TELEGRAM_BOT_TOKEN` | Telegram bot token from @BotFather               | `123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11` |\n| `TELEGRAM_CHANNEL_ID`| Telegram channel ID (public or private)           | `@JaabzJobs` or `-1001234567890`             |\n\n## Troubleshooting\n1. **Telegram \"Too Many Requests\"**:\n    - The application retries up to 3 times with delays. If persistent, reduce the number of jobs fetched or increase the fetch interval in `service.go`.\n    - Check logs:\n      ```\n      level=WARN msg=\"Rate limit hit, retrying\" package=telegram attempt=1 retry_after_seconds=38\n      ```\n\n2. **Telegram \"Not Found\" or Invalid Token**:\n    - Verify `TELEGRAM_BOT_TOKEN` in `.env`.\n    - Test:\n      ```bash\n      curl \"https://api.telegram.org/bot\u003cyour-token\u003e/getMe\"\n      ```\n    - Regenerate token via `@BotFather` if needed.\n\n3. **Invalid Channel ID**:\n    - Ensure `TELEGRAM_CHANNEL_ID` is `@ChannelName` or `-100NNNNNNNNNN`.\n    - For private channels, use `@GetIDsBot`.\n\n4. **Redis Connection Issues**:\n    - Confirm Redis is running:\n      ```bash\n      docker ps  # Check jaabz-redis\n      redis-cli -h localhost -p 6378 ping  # If running locally\n      ```\n    - Update `REDIS_HOST` if using a non-standard port (e.g., `localhost:6378`).\n\n5. **Logs**:\n    - Check `docker logs jaabz-app` or `bin/jaabz` output for errors.\n    - Enable debug logging in `main.go` (`slog.LevelDebug`).\n\n## Contributing\n1. Fork the repository.\n2. Create a feature branch (`git checkout -b feature/xyz`).\n3. Commit changes (`git commit -m \"Add feature xyz\"`).\n4. Push to the branch (`git push origin feature/xyz`).\n5. Open a pull request.\n\n## License\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for details.\n\n\n### Notes on the README\n- **Project Overview**: Describes the application’s purpose (scraping Jaabz jobs, deduplicating with Redis, posting to Telegram).\n- **Docker Integration**: Details the Docker Compose setup, including Redis and the Go app, with port mapping (`6378:6379`) from your configuration.\n- **Environment Variables**: Lists all variables from `docker-compose.yml` and explains how to obtain `TELEGRAM_BOT_TOKEN` and `TELEGRAM_CHANNEL_ID`.\n- **Setup Instructions**: Covers both Docker and local execution, including `make run` and Redis setup.\n- **Usage**: Explains the application’s behavior and shows an example Telegram post.\n- **Directory Structure**: Reflects the provided `ls` output (`bin/`, `cmd/`, etc.).\n- **Troubleshooting**: Addresses common issues (rate limits, invalid tokens, Redis), referencing your recent errors.\n- **Assumptions**:\n    - The `Dockerfile` builds the Go binary to `/app/build` (per `entrypoint` in `docker-compose.yml`).\n    - The `JAABZ_HOST` and Telegram variables are left blank in the example `.env` to be filled by the user.\n    - Redis uses port `6378` externally (mapped to `6379` internally) as per your `docker-compose.yml`.\n\n### Additional Setup Notes\n1. **Dockerfile**: Ensure your `Dockerfile` compiles the Go binary to `/app/build`. Example:\n   ```dockerfile\n   FROM golang:1.22-alpine AS builder\n   WORKDIR /app\n   COPY go.mod go.sum ./\n   RUN go mod download\n   COPY . .\n   RUN go build -o build ./cmd/.\n\n   FROM alpine:latest\n   WORKDIR /app\n   COPY --from=builder /app/build .\n   CMD [\"/app/build\"]\n   ```\n\n2. **env.example**: Create an `env.example` file to match your `docker-compose.yml`:\n   ```env\n   APP_NAME=jaabz\n   ENVIRONMENT=development\n   JAABZ_HOST=\n   REDIS_HOST=jaabz-redis:6379\n   TELEGRAM_CHANNEL_ID=\n   TELEGRAM_BOT_TOKEN=\n   ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilad-rasouli%2Fjaabz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilad-rasouli%2Fjaabz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilad-rasouli%2Fjaabz/lists"}