galeone/fitbit

GET: Nutrition and Nutrition timeseries

Open

#1 建立於 2022年11月5日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Go (2 fork)github user discovery
help wanted

倉庫指標

Star
 (10 star)
PR 合併指標
 (PR 指標待抓取)

描述

The Fitbit client misses the support for (at least all the GET endpoints of):

I don't log the food, so I don't have data for automatically generating with galeone/rts the structs, and thus there's no support for this (yet).

If someone want's to help, it only needs to follow the steps in the readme to create an application, and than use rts in this way:

var req *http.Client
req, err = fitbitAuthorizer.HTTP()
if err != nil {
    return err
}

// Build the various requests path (pay attention to the parameters)
// and foreach of this `dest`
if res, err = req.Get(dest); err != nil {
    return err
}

var body []byte
if body, err = io.ReadAll(res.Body); err != nil {
    return err
}
bodyString := string(body)
// RTS usage: creates the content inside a "types" package
if pack, err = rts.DoRaw("types", bodyString); err != nil {ù
    return err
}
// Save the content.

Once you have the generated content saved, you have to manually edit all the Foo structures (it's easy, just look at the documentation for the fields) and organized the structs in the very same way these are already organized in the types folder.

貢獻者指南