Add the `GetBrengUrl` method to `Quay`

main
Jasper Bok 2023-08-18 17:04:56 +02:00
parent 3d6478916e
commit f52890f58a
1 changed files with 7 additions and 0 deletions

View File

@ -1,7 +1,9 @@
package main
import (
"fmt"
"net/http"
"net/url"
)
type Route struct {
@ -26,6 +28,11 @@ func (q Quay) IsInterestingDeparture(d Departure) bool {
return false
}
func (q Quay) GetBrengUrl() string {
param := fmt.Sprintf("{\"quayid\":\"%s\",\"name\":\"%s\",\"town\":\"%s\"}", q.ID, q.Name, q.Town)
return fmt.Sprint("https://www.breng.nl/nl/resultaten/halte-informatie/?stop=%s", url.QueryEscape(param))
}
var BusClient *http.Client
var Quays []Quay = []Quay{}