diff --git a/cmd/feed.go b/cmd/feed.go index 8312677..e8156ee 100644 --- a/cmd/feed.go +++ b/cmd/feed.go @@ -18,29 +18,27 @@ package cmd import ( "context" - "encoding/json" "fmt" + "io" "log" "github.com/spf13/cobra" - "scm.dairydemon.net/filifa/mlbstats/api" ) func feed(cmd *cobra.Command, args []string) { - client := api.NewAPIClient(api.NewConfiguration()) - req := client.GameAPI.LiveGameV1(context.Background(), gamePk) + req := statsAPIClient.GameAPI.LiveGameV1(context.Background(), gamePk) resp, err := req.Execute() if err != nil { log.Fatal(err) } - json, err := json.Marshal(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) } - fmt.Println(string(json)) + fmt.Println(string(body)) } // feedCmd represents the feed command