add filter for furnished/unfurnished type for rented listings

This commit is contained in:
Viktor Barzin 2025-05-18 17:22:48 +00:00
parent b873eaf203
commit 9f3e466b23
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
3 changed files with 41 additions and 16 deletions

View file

@ -1,7 +1,7 @@
import asyncio
from dataclasses import dataclass
import pathlib
from rec.query import ListingType, listing_query
from rec.query import ListingType, listing_query, FurnishType
from rec.districts import get_districts
from data_access import Listing
@ -17,7 +17,11 @@ class QueryParameters:
radius: float = 0
page_size: int = 500 # items per page
max_days_since_added: int = 30
# available from; furnished/unfurnished; council tax
furnish_types: list[FurnishType] | None = None
# The values below are not supported by rightmove
# hence we apply them after fetching
# available from; council tax
async def dump_listings(
@ -44,6 +48,7 @@ async def dump_listings(
location_id=locid,
page_size=parameters.page_size,
max_days_since_added=parameters.max_days_since_added,
furnish_types=parameters.furnish_types or [],
) for locid in districts.values() for i in [1, 2]
])
listings = []