This project is a command-line app containing a cron-job that will frequently crawl R**htMve* & *Z**pla to find new apartments for you and post them to Slack, given a specific set of search criteria.
NB: It can be somewhat temperamental since a lot of checks are in place to prevent crawlers on these websites. Changes will be inevitable.
- Clone this repository
- Select the correct node version (e.g. with nvm)
- Install dependencies
- Copy and populate the environment variables
- Update the config files with your search parameters
- Start the command-line app
$ git clone [email protected]:maxkramer/london-apartment-bot.git && cd london-apartment-bot
$ nvm use
$ npm install
$ mv .env.example .env
$ npm start
There's a convenience Make task for this; simply run make
to start it up.
In production mode, logs are written to $PWD/cron-job.log
with pino. Simply tail
this file.
$ npm start
To run this project, you will need to populate the following environment variables in your .env file:
Name | Description | Default Value |
---|---|---|
SLACK_TOKEN | A Slack API user-token that you can get from: https://api.slack.com/authentication/token-types | undefined |
SLACK_CHANNEL | The Channel (id) that you would like to post the apartments to | undefined |
DATABASE_HOST | The host of the postgres instance e.g. localhost, IP address, fqdn | localhost |
DATABASE_PORT | The port of the postgres instance (usually 5432) | 5432 |
DATABASE_USERNAME | The username to login to the postgres instance with | postgres |
DATABASE_PASSWORD | The password to login to the postgres instance with | password |
DATABASE_NAME | The name of the database to store the listings in, that the user has access to | londonapartmentbot |
All configuration specific to the different adapters can be found in the relevant adapter file.
Simply set the enabled
flag to true
or false
.
The parameters that can be changed are:
name
: The name to show in Slackenabled
: Whether the adapter is enabled or disabledmaxPrice
: The maximum price of listings to showminPrice
: The minimum price of listings to showminBeds
: The minimum number of beds in a listing to showfurnished
: Whether it should show only furnished apartmentsslackIcon
: The icon to use for this adapter in Slack
Simply change the relevant sections in this file.
Creative Commons Attribution-NonCommercial 4.0 International Public License