This bot allows users to set filters for Craigslist items and receive notifications via Telegram when matching listings are found.
- Users can add filters for specific items, price ranges, and locations.
- Filters are stored persistently in a JSON file.
- Notifications are sent via Telegram when a matching listing is found.
- Users can view and edit their filters at any time.
- Python 3.8+
- A Telegram bot token (register via BotFather)
- A Raspberry Pi or other hosting environment (optional)
-
Clone this repository:
git clone https://github.com/your-repo/craigslist-filter-bot.git cd craigslist-filter-bot -
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory and add your Telegram bot token:TOKEN=your_telegram_bot_token_here
-
Run the bot:
python main.py
- Start a chat with your Telegram bot.
- Use
/startto begin the filter setup. - Follow the bot's prompts to specify:
- Item name
- Price range
- Location
- The bot will monitor Craigslist and notify you when matching listings appear.
- Use commands to manage your filters:
/add_filter– Add a new filter/view_filters– View existing filters/edit_filter– Modify an existing filter/delete_filter– Remove a filter
- The bot stores filters in a JSON file (
filters.json). - Modify
constants/constants.pyif you need to change file paths or other settings.
- You can run this bot on a Raspberry Pi or a cloud server.
- Consider using
systemdorscreen/tmuxto keep it running persistently.
- Add advanced filtering options (e.g., keyword matching, auto-refresh rates).
- Improve user interaction with inline buttons.
This project is licensed under the MIT License.