• This repository has been archived on 17/Mar/2023
  • Stars
    star
    1,058
  • Rank 42,583 (Top 0.9 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Slack bot that helps you find an apartment.

Apartment finder

This repo contains the code for a bot that will scrape Craigslist for real-time listings matching specific criteria, then alert you in Slack. This will let you quickly see the best new listings, and contact the owners. You can adjust the settings to change your price range, what neighborhoods you want to look in, and what transit stations and other points of interest you'd like to be close to.

I successfully used this tool to find an apartment when I moved from Boston to SF. It saved a good amount of time and money. Read more about it here.

It's recommended to follow the Docker installation and usage instructions.

Settings

Look in settings.py for a full list of all the configuration options. Here's a high level overview:

  • MIN_PRICE -- the minimum listing price you want to search for.
  • MAX_PRICE -- the minimum listing price you want to search for.
  • CRAIGSLIST_SITE -- the regional Craigslist site you want to search in.
  • AREAS -- a list of areas of the regional Craiglist site that you want to search in.
  • BOXES -- coordinate boxes of the neighborhoods you want to look in.
  • NEIGHBORHOODS -- if the listing doesn't have coordinates, a list of neighborhoods to match on.
  • MAX_TRANSIT_DISTANCE -- the farthest you want to be from a transit station.
  • TRANSIT_STATIONS -- the coordinates of transit stations.
  • CRAIGSLIST_HOUSING_SECTION -- the subsection of Craigslist housing that you want to look in.
  • SLACK_CHANNEL -- the Slack channel you want the bot to post in.

External Setup

Before using this bot, you'll need a Slack team, a channel for the bot to post into, and a Slack API key:

  • Create a Slack team, which you can do here.
  • Create a channel for the listings to be posted into. Here's help on this. It's suggested to use #housing as the name of the channel.
  • Get a Slack API token, which you can do here. Here's more information on the process.

Configuration

Docker

  • Create a folder called config, then put a file called private.py inside.
  • Specify new values for any of the settings above in private.py.
    • For example, you could put AREAS = ['sfc'] in private.py to only look in San Francisco.
    • If you want to post into a Slack channel not called housing, add an entry for SLACK_CHANNEL.
    • If you don't want to look in the Bay Area, you'll need to update the following settings at the minimum:
      • CRAIGSLIST_SITE
      • AREAS
      • BOXES
      • NEIGHBORHOODS
      • TRANSIT_STATIONS
      • CRAIGSLIST_HOUSING_SECTION
      • MIN_PRICE
      • MAX_PRICE

Manual

  • Create a file called private.py in this folder.
    • Add a value called SLACK_TOKEN that contains your Slack API token.
    • Add any other values you want to private.py.

Installation + Usage

Docker

  • Make sure to do the steps in the configuration section above first.
  • Install Docker by following these instructions.
  • To run the program with the default configuration:
    • docker run -d -e SLACK_TOKEN={YOUR_SLACK_TOKEN} dataquestio/apartment-finder
  • To run the program with your own configuration:
    • docker run -d -e SLACK_TOKEN={YOUR_SLACK_TOKEN} -v {ABSOLUTE_PATH_TO_YOUR_CONFIG_FOLDER}:/opt/wwc/apartment-finder/config dataquestio/apartment-finder

Manual

  • Look in the Dockerfile, and make sure you install any of the apt packages listed there.
  • Install Python 3 using Anaconda or another method.
  • Install the Python requirements with pip install -r requirements.txt.
  • Run the program with python main_loop.py. Results will be posted to your #Housing channel if successful.

Troubleshooting

Docker

  • Use docker ps to get the id of the container running the bot.
  • Run docker exec -it {YOUR_CONTAINER_ID} /bin/bash to get a command shell inside the container.
  • Run sqlite listings.db to run the sqlite command line tool and inspect the database state (the only table is also called listings).
    • select * from listings will get all of the stored listings.
    • If nothing is in the database, you may need to wait for a bit, or verify that your settings aren't too restrictive and aren't finding any listings.
    • You can see how many listings are being found by looking at the logs.
  • Inspect the logs using tail -f -n 1000 /opt/wwc/logs/afinder.log.

Manual

  • Look at the stdout of the main program.
  • Inspect listings.db to ensure listings are being added.

Deploying

  • Create a server that has Docker installed. It's suggested to use Digital Ocean.
  • Follow the configuration + installation instructions for Docker above.

More Repositories

1

marker

Convert PDF to markdown quickly with high accuracy
Python
9,051
star
2

surya

OCR, layout analysis, reading order, line detection in 90+ languages
Python
7,035
star
3

zero_to_gpt

Go from no deep learning knowledge to implementing GPT.
Jupyter Notebook
813
star
4

texify

Math OCR model that outputs LaTeX and markdown
Python
523
star
5

textbook_quality

Generate textbook-quality synthetic LLM pretraining data
Python
449
star
6

libgen_to_txt

Convert all of libgen to high quality markdown
Python
223
star
7

pdftext

Extract structured text from pdfs quickly
Python
204
star
8

scribe

Simple speech recognition using your microphone.
Python
122
star
9

researcher

Concise answers to search queries using Google and GPT-3. Includes citations.
Python
70
star
10

scan

Score essays automatically with an easy web interface.
Python
40
star
11

evolve-music2

Evolve music automatically with python -- rewrite of evolve-music.
Python
40
star
12

classified

Score LLM pretraining data with classifiers
Python
35
star
13

evolve-music

Superseded by github.com/vikparuchuri/evolve-music2 -- use that instead.
C
25
star
14

simpsons-scripts

Find out how much the simpsons characters like each other with text and audio analysis.
Python
23
star
15

movide

The student-centric learning platform.
Python
18
star
16

snapcheck

Find out if your info was leaked.
Python
15
star
17

political-positions

Analyze politics.
Python
14
star
18

vikparuchuri.com

Code for vikparuchuri.com -- personal blog.
Ruby
13
star
19

boston-python-ml

Text scoring/classification presentation
JavaScript
9
star
20

percept

A modular machine learning framework that is easy to test and deploy.
Python
9
star
21

wp-deployment

Deploy wordpress with multisite to ec2 with ansible.
Python
7
star
22

spotify-export

Export albums from Spotify into Google Play Music.
Python
7
star
23

algorithms

Pure python implementations of various algorithms, including a matrix class.
Python
6
star
24

vikparuchuri-affirm

CSS
5
star
25

ds-webinar

How to learn data science webinar presentation
CSS
5
star
26

nyt-articles

Get articles from new york times API.
Python
5
star
27

triton_tutorial

Tutorials for Triton, a language for writing gpu kernels
Jupyter Notebook
4
star
28

pdf_to_md

Python
4
star
29

ml-math

Svelte
3
star
30

TulaLensSurvey

Android app that makes it easy to survey people.
Java
3
star
31

medicare-analysis

Analyze medicare data from the recent release.
CSS
3
star
32

sports-stats

Try to rethink sports statistics.
Python
3
star
33

bostonpython2015

Presentation for boston python 2015
CSS
2
star
34

dscontent-starter

2
star
35

Presentations

JavaScript
1
star
36

vik-blog

HTML
1
star
37

tulalens-survey-web

Web component of android survey app.
Ruby
1
star
38

nextml-talk

CSS
1
star
39

vj-wedding2

A site I made for a wedding.
JavaScript
1
star
40

matter

Chrome extension that highlights important passages.
JavaScript
1
star
41

vj-wedding

Placeholder site for a wedding (with countdown)
JavaScript
1
star
42

affirm-themes

Themes for affirm.io.
CSS
1
star
43

openphi

1
star