summaryrefslogtreecommitdiff
path: root/flat.go
blob: 5f2200973e64c5ad9e4c9b41987151f6ab23f2bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package main

import (
	"cmp"
	"fmt"
)

type flat struct {
	ID    int    `json:"id"`
	Price string `json:"price"`
}

func (f *flat) URL() string {
	return fmt.Sprintf("https://rightmove.co.uk/properties/%v", f.ID)
}

func compareID(a, b flat) int {
	return cmp.Compare(a.ID, b.ID)
}