Find relevant facebook post about apartments based on keywords.
- Python 3 installed (
python3 --version) pipenvinstalled (pip3 install --user pipenv)
- Clone the repository:
git clone git@github.com:maynir/find-apartment.git - Navigate to the project directory:
cd find-apartment - Run the setup script:
./setup.sh- This script will:
- Install pipenv if not already installed
- Install MongoDB (for macOS users) if not already installed
- Start the MongoDB service
- Verify MongoDB is running correctly
- Install all project dependencies using pipenv
- Create the required MongoDB database and collection
- This script will:
- Activate the virtual environment:
pipenv shell- To deactivate run:
exit
- To deactivate run:
Create a configuration file src/etc/config.py and fill in the necessary settings:
MY_EMAIL = "your_facebook_email@gmail.com"
PASSWORD = "your_facebook_password"
MONGO_CONNECTION = "mongodb://localhost:27017/"
TELEGRAM_CHAT_ID = ""
TELEGRAM_BOT_TOKEN = ""
OPENAI_API_KEY = "your_openai_api_key"
MIN_PRICE = 5000 # set your minimum price here
BUDGET_THRESHOLD = 10000 # set your maximum budget threshold hereThe setup script automatically handles MongoDB installation and configuration for macOS users. It will:
- Install MongoDB Community Edition 7.0 if not already installed
- Start the MongoDB service
- Verify the MongoDB connection
- Create the required database (
apartmentsdb) and collection (apartments)
If you need to manually manage MongoDB:
- Install MongoDB
brew tap mongodb/brew brew install mongodb-community@7.0
- Start MongoDB
brew services start mongodb-community@7.0
- Verify MongoDB is running
ps aux | grep mongod - Connect to MongoDB
mongosh use apartmentsdb
To use my project, follow these steps:
python3 src/facebook_main.py
python3 src/yad2_main.pyTo run the tests:
pipenv run pytest tests/test_openai_helper.py -vInstall dependencies
pipenv installTo format the code, run:
pipenv run black .To sort imports, run:
pipenv run isort .