This is a bot that scrapes new entries on WG Gesucht and sends notifications via Telegram when there is a new entry. It helps you stay updated on new listings for any search query you want. It is able to serve mutliple users that can subscribe to different search queries.
To use this bot, follow these steps:
- Clone the repository:
git clone https://github.com/JeremieSiller/kleinanzeigen_bot.git
- Install the dependencies using Poetry:
poetry install
- create
.env
file in the root directory and add the following variables:
TELEGRAM_TOKEN=your_telegram_bot_token # check step 5
IDS_FILE_NAME=ids.db
LINK_FILE_NAME=links.db
- Create the files
ids.db
andlinks.db
in the root directory:
touch ids.db
touch links.db
- Obtain a Telegram Bot token from BotFather and add it to the
.env
file underTELEGRAM_TOKEN
. - Run the bot:
poetry run python main.py
- send
/start
to your bot and it will start scraping the urls you provided and send you a message with the new listings.
- if you want to use certain filters, just add them on wg-gesucht and copy the new url to the
/start
command.
Alternatively, you can use Docker to run the bot:
- Build the Docker image:
docker build -t telegram-scraper .
- Run the Docker container:
docker run telegram-scraper
This project is licensed under the MIT License.
This project was created as a learning experience and is not intended for production use. It is not affiliated with Kleinanzeigen or WG Gesucht.
- add kleinanzeigen (and other webpages)
- use actual database instead of shelve
- handle race conditions properly
- write tests