mirror of
https://github.com/Xevion/r2park.git
synced 2025-12-06 09:16:03 -06:00
Capture data-locate-key for new GetForm API functions
This commit is contained in:
3
api.go
3
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],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user