forked from VikParuchuri/apartment-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
161 lines (140 loc) · 4.95 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import os
## Search Filters
PARKING = ['carport', 'attached garage', 'detached garage', 'off-street parking', 'street parking', 'valet parking']
SEARCH_FILTERS = {"max_price": 2000,
"min_price": 0,
"parking": PARKING}
## Location preferences
# The Craigslist site you want to search on.
# For instance, https://sfbay.craigslist.org is SF and the Bay Area.
# You only need the beginning of the URL.
CRAIGSLIST_SITE = 'losangeles'
# What Craigslist subdirectories to search on.
# For instance, https://sfbay.craigslist.org/eby/ is the East Bay, and https://sfbay.craigslist.org/sfc/ is San Francisco.
# You only need the last three letters of the URLs.
AREAS = ["wst", "sfv", "lac", "sgv", "lgb", "ant"]
# A list of neighborhoods and coordinates that you want to look for apartments in. Any listing that has coordinates
# attached will be checked to see which area it is in. If there's a match, it will be annotated with the area
# name. If no match, the neighborhood field, which is a string, will be checked to see if it matches
# anything in NEIGHBORHOODS.
BOXES = {
# "la": [
# [33.788279, -118.547974],
# [34.066312, -118.155289]
# ],
"Marina Del Rey": [
[33.959878, -118.47888],
[33.992192, -118.430214]
],
"Venice": [
[33.987068, -118.501453],
[34.007206, -118.445406]
],
"Santa Monica": [
[34.006317, -118.51686],
[34.048535, -118.432789]
],
"Culver City": [
[33.978812, -118.43914],
[34.049299, -118.348696]
],
"Playa Vista": [
[33.943974, -118.458785],
[33.977816, -118.397598]
],
"Inglewood": [
[33.927978, -118.405876],
[34.003293, -118.278637]
],
# "DTLA": [
# [34.00742, -118.282585],
# [34.081633, -118.210521]
# ],
# "Hollywood": [
# [34.029918, -118.470538],
# [34.104112, -118.275032]
# ],
"El Segundo": [
[33.900199, -118.442526],
[33.934735, -118.368931]
],
"Hawthorne": [
[33.898886, -118.37071],
[33.933422, -118.257694]
],
"Manhattan Beach": [
[33.872839, -118.423722],
[33.90251, -118.370476],
],
"Gardena": [
[33.871968, -118.37135],
[33.90164, -118.263531]
],
"Hermosa Beach": [
[33.847449, -118.415116],
[33.87713, -118.250656]
],
"Redondo Beach": [
[33.786236, -118.412189],
[33.851472, -118.35331]
],
"Torrance": [
[33.787151, -118.354755],
[33.852387, -118.279187]
],
"Carson": [
[33.786885, -118.29679],
[33.871122, -118.202307]
],
# "Long Beach": [
# [33.730575, -118.2148],
# [33.873782, -118.118869]
# ]
}
# A list of neighborhood names to look for in the Craigslist neighborhood name field. If a listing doesn't fall into
# one of the boxes you defined, it will be checked to see if the neighborhood name it was listed under matches one
# of these. This is less accurate than the boxes, because it relies on the owner to set the right neighborhood,
# but it also catches listings that don't have coordinates (many listings are missing this info).
NEIGHBORHOODS = ["marina del rey", "venice", "santa monica", "culver city", "mar vista", "playa vista",
"inglewood", "el segundo", "gardena", "hawthorne", "manhattan",
"manhattan beach", "hermosa", "hermosa beach", "torrance"]
## Transit preferences
# The farthest you want to live from a transit stop.
MAX_TRANSIT_DIST = 2 # kilometers
# Transit stations you want to check against. Every coordinate here will be checked against each listing,
# and the closest station name will be added to the result and posted into Slack.
TRANSIT_STATIONS = {
}
## The location
WORK_LOCATION = [33.9205867, -118.3271398]
TIME_TO_WORK = "8:30"
TIME_FROM_WORK = "19:00"
## Search type preferences
# The Craigslist section underneath housing that you want to search in.
# For instance, https://sfbay.craigslist.org/search/apa find apartments for rent.
# https://sfbay.craigslist.org/search/sub finds sublets.
# You only need the last 3 letters of the URLs.
CRAIGSLIST_HOUSING_SECTION = 'apa'
## System settings
# How long we should sleep between scrapes of Craigslist.
# Too fast may get rate limited.
# Too slow may miss listings.
SLEEP_INTERVAL = 10 * 60 # 10 minutes
# Which slack channel to post the listings into.
SLACK_CHANNEL = "#housing"
# The token that allows us to connect to slack.
# Should be put in private.py, or set as an environment variable.
SLACK_TOKEN = os.getenv('SLACK_TOKEN', "")
# The token that allows us to connect to walkscore.
# Should be put in private.py, or set as an environment variable.
WS_API_KEY = os.getenv('WS_API_KEY', "")
# Any private settings are imported here.
try:
from private import *
except Exception:
pass
# Any external private settings are imported from here.
try:
from config.private import *
except Exception:
pass