Skip to content

Commit 52acf17

Browse files
authored
Merge pull request #172 from kavith-k/update-url
Update API endpoint URL
2 parents 2bf5f7e + fb3b062 commit 52acf17

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99

1010
jobs:
1111
tests:
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v3

daftlistings/daft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
class Daft:
14-
_ENDPOINT = "https://gateway.daft.ie/old/v1/listings"
14+
_ENDPOINT = "https://gateway.daft.ie/api/v2/ads/listings"
1515
_HEADER = {
1616
"User-Agent": "",
1717
"Content-Type": "application/json",

tests/test_daft_search.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class DaftTest(unittest.TestCase):
2121
@patch("requests.post")
2222
def test_search_basic(self, mock_post):
23-
url = "https://gateway.daft.ie/old/v1/listings"
23+
url = "https://gateway.daft.ie/api/v2/ads/listings"
2424
payload = {
2525
"paging": {"from": "0", "pagesize": "50"},
2626
}
@@ -37,7 +37,7 @@ def test_search_basic(self, mock_post):
3737

3838
@patch("requests.post")
3939
def test_search_properties_for_sale(self, mock_post):
40-
url = "https://gateway.daft.ie/old/v1/listings"
40+
url = "https://gateway.daft.ie/api/v2/ads/listings"
4141
payload = {
4242
"section": "residential-for-sale",
4343
"andFilters": [
@@ -94,7 +94,7 @@ def test_search_properties_for_sale(self, mock_post):
9494

9595
@patch("requests.post")
9696
def test_search_properties_for_rent(self, mock_post):
97-
url = "https://gateway.daft.ie/old/v1/listings"
97+
url = "https://gateway.daft.ie/api/v2/ads/listings"
9898
payload = {
9999
"section": "residential-to-rent",
100100
"andFilters": [
@@ -145,7 +145,7 @@ def test_search_properties_for_rent(self, mock_post):
145145

146146
@patch("requests.post")
147147
def test_search_multiple_areas(self, mock_post):
148-
url = "https://gateway.daft.ie/old/v1/listings"
148+
url = "https://gateway.daft.ie/api/v2/ads/listings"
149149
payload = {
150150
"section": "residential-to-rent",
151151
"geoFilter": {
@@ -173,7 +173,7 @@ def test_search_multiple_areas(self, mock_post):
173173

174174
@patch("requests.post")
175175
def test_shared_listings(self, mock_post):
176-
url = "https://gateway.daft.ie/old/v1/listings"
176+
url = "https://gateway.daft.ie/api/v2/ads/listings"
177177
payload = {
178178
"section": "sharing",
179179
"filters": [

0 commit comments

Comments
 (0)