aboutsummaryrefslogtreecommitdiff

I wrote this script when I moved to London and was desperately looking for houses to rent in the tough and fast paced rental market. OpenRent seemed nice, but its filters were not good enough for me to express my exacting requirements. So, I wrote a script that

  • scraped the OpenRent website to extract house details
  • called the OpenStreetMap Open Source Routing Machine (OSRM) API to find the distance to work by bicycle
  • called the Transport for London to identify tube stations and lines

The script prints out exactly the details I was looking for in a concise form. Typical output looks something like:

1 Bed Flat, Lyonsdown Rd, EN5 (posted 58 hours ago)
https://www.openrent.co.uk/1566437
£1350 pcm
Cycling distance: 16.4 km
Tube: High Barnet (northern), Totteridge & Whetstone (northern)

1 Bed Flat, Page Green Terrace, N15 (posted 56 hours ago)
https://www.openrent.co.uk/1571987
£1400 pcm
Cycling distance: 9.1 km
Tube: Seven Sisters (victoria)

1 Bed Flat, Neasden Lane, NW10 (posted 56 hours ago)
https://www.openrent.co.uk/1571965
£1280 pcm
Cycling distance: 13.2 km
Tube: Neasden (jubilee), Dollis Hill (jubilee), Wembley Park (jubilee metropolitan)

1 Bed Maisonette, Albert Road, E18 (posted 6 hours ago)
https://www.openrent.co.uk/1573365
£1200 pcm
Cycling distance: 17.0 km
Tube: South Woodford (central), Snaresbrook (central), Redbridge (central), Wanstead (central)

How to run

Set the coordinates of your workplace in the %work-coordinates% variable. Specify the criteria for shortlisting at the end of the script as the last expression. Create the cache directory if it doesn't already exist. Drop into a shell with the required dependencies installed. Guix is the easiest way to do this, but you can do it any way you like. Finally, run the script.

$ mkdir -p cache
$ guix shell -m manifest.scm
[env]$ guile rent.scm