sunlight-api/example/example.go

37 lines
926 B
Go
Raw Normal View History

2016-06-16 16:22:03 +00:00
package main
import (
"fmt"
"os"
"github.com/br0xen/sunlight-api/openstates"
)
func main() {
var apiKey string
if len(os.Args) > 1 {
apiKey = os.Args[1]
} else {
fmt.Println("Usage: example <apikey>")
return
}
o := openstates.Create(apiKey)
//d, err := o.StateMetadata(states.Kansas)
2016-06-16 17:26:36 +00:00
//d, err := o.GetBillDetailFromID("KSB00002165")
2016-06-16 16:22:03 +00:00
//d, err := o.GetBillDetail(states.Kansas, "2013-2014", "HR 6020")
2016-06-16 17:26:36 +00:00
//d, err := o.GetLegislatorsForState(states.Kansas)
//d, err := o.GetLegislatorDetail("KSL000018")
2016-06-17 18:37:49 +00:00
//d, err := o.GetLegislatorsForGeo(35.79, -78.78)
//v := url.Values{}
//d, err := o.SearchEvents(v)
//d, err := o.GetEventsForState(states.Texas)
//d, err := o.GetEventDetail("TXE00028743")
//d, err := o.GetDistrictsForState(states.Kansas)
d, err := o.GetDistrictBoundary("ocd-division/country:us/state:ks/sldu:33")
2016-06-16 16:22:03 +00:00
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Printf("%+v\n", d)
}