This Telegram bot notifies you in whenever a new ad appears in the specified topic
414
Clone the repository:
git clone https://github.com/debMan/divar-telegram-bot.git
cd divar-telegram-bot
cp .env.sample .env
echo '[]' > tokens.json
# on Mac
gsed -ri 's|PATH_TO_YOUR_DIR|'"$PWD"'|g' docker-compose.yml
# on GNU/Linux
# sed -ri 's|PATH_TO_YOUR_DIR|'"$PWD"'|g' docker-compose.yml
Open @BotFather in Telegram.
Create a new bot, and place ist token (Or use an existing bot token) into the .env file.
BOT_TOKEN = '<BOT-TOKEN-HERE>'
Send a message to @getidsbot and the response should be something like this:
Copy the id and paste it to .env file:
BOT_CHATID = '<CHAT-ID-HERE>'
Open your new (or old) bot (from step 2) and press Start (So the bot can send you messages).
Go to https://divar.ir/, select your city and go to the desired category. Choose some search conditions like this:

The web browser's URL should be something like this:
https://divar.ir/s/mashhad/rent-residential/janbaz?districts=1124%2C442&credit=-100000000&rent=-3000000&size=-90
Copy everything after https://divar.ir/s/, in this case, it will be mashhad/rent-residential/janbaz?districts=1124%2C442&credit=-100000000&rent=-3000000&size=-90
So, paste this as SEARCH_CONDITIONS in the .env file:
SEARCH_CONDITIONS = "mashhad/rent-residential/janbaz?districts=1124%2C442&credit=-100000000&rent=-3000000&size=-90"
Tune other parameters on .env file with your desired spec
Run the service:
docker compose up --build -d

Content type
Image
Digest
sha256:a9bc4066e…
Size
375.5 MB
Last updated
over 2 years ago
docker pull idebman/divar-telegram-bot:sha-68faee0