Bot that tracks new ads at sahibinden.com and notifies telegram channel.
It can be used for tracking new ads for any provided url of search page. For example, if you want to be notified about new ads in "Computers > Laptops & Notebooks" in the Izmir city:
https://www.sahibinden.com/en/computers-laptops-notebooks?address_city=35
- httpx to make http requests
- BeautifulSoup to parse html
- pydantic to type objects
- aiogram to send messages to telegram
- s3-objects-tracker to track already processed ads
The bot is running as Yandex.Function, so it can be triggered by cron job.
But also you can run it on AWS Lambda or Google Cloud Functions.
It's required to use proxy to make requests to sahibinden.com outside Turkey.
$ python3 main.py
Sahibinden-bot should be configured using environment variables.
The optimal way is to create an .env
file in the root sahibinden_bot
directory.
SAHIBINDEN_SOURCE_URL='https://www.sahibinden.com/en/computers-laptops-notebooks?address_city=35'
TELEGRAM_BOT_TOKEN='bot_token'
TELEGRAM_CHANNEL_ID='channel_id '
AWS_ACCESS_KEY_ID='aws_access_key_id'
AWS_SECRET_ACCESS_KEY='aws_access_key_id'
AWS_BUCKET_NAME='aws_bucket_name'
AWS_ENDPOINT_URL='https://s3.amazonaws.com'
SENTRY_DSN='sentry_dsn'
PROXY_URL='http://user:pass@ip:port'
PROXY_URL_BACKUP='http://user:pass@ip:port'