Added kmb and refactored query.Parse
This commit is contained in:
@@ -45,9 +45,15 @@ func getSchedule( lang string, routeName string ) ( *BusSchedule, error ) {
|
||||
"mtr_bsch" + "-" + lang + "-" + routeName + ".json",
|
||||
)
|
||||
|
||||
postLang := "en"
|
||||
if lang == "zh-Hant" {
|
||||
postLang = "zh"
|
||||
|
||||
}
|
||||
|
||||
QUERY_FUNC := func() ( io.ReadCloser, error ) {
|
||||
// Query Remote
|
||||
values := map[string]string { "language": lang , "routeName": routeName }
|
||||
values := map[string]string { "language": postLang, "routeName": routeName }
|
||||
jsonValue, _ := json.Marshal(values)
|
||||
resp, err := http.Post(
|
||||
"https://rt.data.gov.hk/v1/transport/mtr/bus/getSchedule",
|
||||
|
||||
Reference in New Issue
Block a user