-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
133 lines (115 loc) · 4.28 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
import os
## Price
# The minimum rent you want to pay per month.
MIN_PRICE = 1500
# The maximum rent you want to pay per month.
MAX_PRICE = 4000
## 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 = 'boston'
# 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 = ["gbs"]
# 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 = {
"davis square": [
[42.3909135223, -71.129693985,],
[42.4047946835, -71.1127853394]
]
# ],
# "adams_point": [
# [37.80789, -122.25000],
# [37.81589, -122.26081],
# ],
# "piedmont": [
# [37.82240, -122.24768],
# [37.83237, -122.25386],
# ],
# "rockridge": [
# [37.83826, -122.24073],
# [37.84680, -122.25944],
# ],
# "berkeley": [
# [37.86226, -122.25043],
# [37.86781, -122.26502],
# ],
# "north_berkeley": [
# [37.86425, -122.26330],
# [37.87655, -122.28974],
# ],
# "pac_heights": [
# [37.79124, -122.42381],
# [37.79850, -122.44784],
# ],
# "lower_pac_heights": [
# [37.78554, -122.42878],
# [37.78873, -122.44544],
# ],
# "haight": [
# [37.77059, -122.42688],
# [37.77086, -122.45401],
# ],
# "sunset": [
# [37.75451, -122.46422],
# [37.76258, -122.50825],
# ],
# "richmond": [
# [37.77188, -122.47263],
# [37.78029, -122.51005],
# ],
# "presidio": [
# [37.77805, -122.43959],
# [37.78829, -122.47151],
# ]
}
# 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 = ["medford", "somerville", "arlington", "cambridge", "everett", "charlestown"]
NEIGHBORHOODS = ["somerville"]
## 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 = {
"davis square": [42.396800,71.121802]
# "oakland_19th_bart": [37.8118051,-122.2720873],
# "macarthur_bart": [37.8265657,-122.2686705],
# "rockridge_bart": [37.841286,-122.2566329],
# "downtown_berkeley_bart": [37.8629541,-122.276594],
# "north_berkeley_bart": [37.8713411,-122.2849758]
}
## 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 = 'aap'
## System settings
# How long we should sleep between scrapes of Craigslist.
# Too fast may get rate limited.
# Too slow may miss listings.
SLEEP_INTERVAL = 20 #* 60 # 20 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 = 'xoxp-131242784261-131834380854-212964626486-295a8a6f8ef27e24dabd8abd64d559eb'
# 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