-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
68 lines (52 loc) · 2.64 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
import os
## Price
# The minimum rent you want to pay per month.
MIN_PRICE = 800
# The maximum rent you want to pay per month.
MAX_PRICE = 3000
## 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 = 'sfbay'
# 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 = ["sfc"]
# 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 = {
"mission-bernal-soma-mbay-dogpatch-potrero": [[-122.435441,37.747317], [-122.375024,37.783347]],
"nobhill-russianhill": [[-122.42385,37.793291], [-122.399395,37.809851]]
}
# 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", "castro", "mission district", "mission", "potrero", "dogpatch", "bernal heights", "nob hill", "hayes valley", "hayes"]
## 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'
CATEGORIES = ["apa", "roo"]
## 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 = "#sf-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', "")
# Any private settings are imported here.
try:
import private
SLACK_TOKEN = private.SLACK_TOKEN
print("Slack token imported from private settings file.")
except Exception:
pass