Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions daftlistings/daft.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def __init__(self):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Origin": "https://www.daft.ie",
"Referer": "https://www.daft.ie/",
}

def set_headers(self, headers: Dict[str, str]):
Expand Down
1 change: 0 additions & 1 deletion examples/map_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
MapVisualization,
)


daft = Daft()
daft.set_location(Location.DUBLIN)
daft.set_search_type(SearchType.RESIDENTIAL_RENT)
Expand Down
12 changes: 12 additions & 0 deletions tests/test_daft_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def test_search_basic(self, mock_post):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Referer": "https://www.daft.ie/",
"Origin": "https://www.daft.ie",
}

daft = Daft()
Expand All @@ -59,6 +61,8 @@ def test_custom_user_agent(self, mock_post):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Referer": "https://www.daft.ie/",
"Origin": "https://www.daft.ie",
}

daft = Daft()
Expand Down Expand Up @@ -99,6 +103,8 @@ def test_search_properties_for_sale(self, mock_post):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Referer": "https://www.daft.ie/",
"Origin": "https://www.daft.ie",
}

daft = Daft()
Expand Down Expand Up @@ -151,6 +157,8 @@ def test_search_properties_for_rent(self, mock_post):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Referer": "https://www.daft.ie/",
"Origin": "https://www.daft.ie",
}

daft = Daft()
Expand Down Expand Up @@ -191,6 +199,8 @@ def test_search_multiple_areas(self, mock_post):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Referer": "https://www.daft.ie/",
"Origin": "https://www.daft.ie",
}

daft = Daft()
Expand Down Expand Up @@ -220,6 +230,8 @@ def test_shared_listings(self, mock_post):
"Content-Type": "application/json",
"brand": "daft",
"platform": "web",
"Referer": "https://www.daft.ie/",
"Origin": "https://www.daft.ie",
}

daft = Daft()
Expand Down