I wanted to write some apps that interface with one bus away and could not find a go api, so I wrote one! One Bus Away Documentation It was also a good excuse to have some fun with golang
$ go get -u github.com/Setheck/oba
import (
"log"
"github.com/Setheck/oba"
)
func main() {
client := oba.NewDefaultClientS(server.URL, TestApiKey)
agency, e := client.Agency("1")
if e != nil {
log.Fatal(e)
}
}
func main() {
client := oba.NewDefaultClientS(server.URL, TestApiKey)
awcs, e := client.AgenciesWithCoverage()
if e != nil {
log.Fatal(e)
}
}
func main() {
client := oba.NewDefaultClientS("http://api.pugetsound.onebusaway.org/api/where/", "TEST")
route, err := client.Route("1_100224")
if err != nil {
log.Fatal(err)
}
log.Print(route.ID)
}