diff --git a/api.go b/api.go index 61a4812..6235d9e 100644 --- a/api.go +++ b/api.go @@ -123,11 +123,14 @@ func GetLocations() []Location { doc.Find("input.property").Each(func(i int, s *goquery.Selection) { matches := parsePattern.FindStringSubmatch(s.Parent().Text()) + + key_attr, _ := s.Attr("data-locate-key") id_attr, _ := s.Attr("value") id, _ := strconv.ParseUint(id_attr, 10, 32) cachedLocations = append(cachedLocations, Location{ id: uint(id), + key: key_attr, name: matches[1], address: matches[2] + " " + matches[3], }) diff --git a/types.go b/types.go index 1b48f3d..83c3462 100644 --- a/types.go +++ b/types.go @@ -2,6 +2,7 @@ package main type Location struct { id uint // Used for registration internally + key string // Used for registration form lookup name string // Used for autocomplete & location selection address string // Not used in this application so far }