Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

120 Commits

Folders and files

Repository files navigation

Find Apartment

Description

Find relevant facebook post about apartments based on keywords.

Prerequisites

  • Python 3 installed (python3 --version)
  • pipenv installed (pip3 install --user pipenv)

Installation

  1. Clone the repository: git clone git@github.com:maynir/find-apartment.git
  2. Navigate to the project directory: cd find-apartment
  3. 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
  4. Activate the virtual environment: pipenv shell
    • To deactivate run: exit

Configuration

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 here

MongoDB Setup

The setup script automatically handles MongoDB installation and configuration for macOS users. It will:

  1. Install MongoDB Community Edition 7.0 if not already installed
  2. Start the MongoDB service
  3. Verify the MongoDB connection
  4. Create the required database (apartmentsdb) and collection (apartments)

If you need to manually manage MongoDB:

  1. Install MongoDB
    brew tap mongodb/brew
    brew install mongodb-community@7.0
  2. Start MongoDB
    brew services start mongodb-community@7.0
  3. Verify MongoDB is running
    ps aux | grep mongod
  4. Connect to MongoDB
    mongosh
    use apartmentsdb

Usage

To use my project, follow these steps:

python3 src/facebook_main.py
python3 src/yad2_main.py

Testing

To run the tests:

pipenv run pytest tests/test_openai_helper.py -v

Development

Install dependencies

pipenv install

To format the code, run:

pipenv run black .

To sort imports, run:

pipenv run isort .

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages