![](https://raw.githubusercontent.com/GridexX/search-coloc/main/./assets/logo.png)
This project showcase how to use the LaCarteDesColocs Email Push Notification with Google API to automate the flat share process.
- A Google Cloud Platform account with the Gmail API and Maps enabled.
- An API key for the Google Maps and Calendar API.
- A
credentials.json
file for the Gmail API. - Mail Notifications from LaCarteDesColocs enabled.
Important
You need to have a .env
file with the following variables:
GOOGLE_API_KEY
: Your Google Maps API key.
git clone git@github.com:GridexX/search-coloc.git
cd search-coloc
npm install
This repository contains a few scripts to automate the flat share process.
Each morning, you received a mail from LaCarteDesColocs with the last announces.
Ths script will retrieve the last announces from the mail and save them into a JSON file.
Announce are sorted by travel_time
from your work and the city center to the announce location.
You can modify the filterApartment function to filter the announces based on your preferences.
function filterApartments(apartments) {
const maxRooms = 5; // 4 roommates and the living room
const minSurface = 10; // 10 m2 for the room
const maxTravelComedie = 12; // 12 minutes by bike to Comedie
const maxTravelPolytech = 20; // 20 minutes by bike to Polytech
return apartments.filter(apartment => {
return apartment.rooms <= maxRooms &&
apartment.roomSurface >= minSurface &&
apartment.travelTimeBikeToComedie <= maxTravelComedie &&
apartment.travelTimeBikeToPolytech <= maxTravelPolytech;
})
}
Filtered Apartments are then saved in a global.csv
file.
This section analyze the announce based on some criteria. It uses the power of ChatGPT to generate a summary of the announce and Notion to save the announce.
Important
For this step, you need to have a Notion Database template downloaded. You need to authorize the integration of your DB in Notion, see here.
You also must have a NOTION_TOKEN
and NOTION_DATABASE_ID
in your .env
file.
You can find the Notion Database template here
Once you met the pre-requisites, you can run the script to analyze the announces.
- Copy the announce and insert it into the prompt.
export ANNOUNCE=$(pbpaste)
envsubst < prompt.txt > prompt2
- Copy the prompt into ChatGPT and generate a summary of the announce.
- Copy the generated command into the terminal !
- The script will generate a summary of the announce and save it into your Notion Database 🤩
- Remove the
prompt2
file.
Tip
Update the prompt.txt
to match your preferences. Also, you can modify the Notion Template to save more information about the announce.