https://docs.bsky.app/docs/api/app-bsky-graph-get-follows
(pds string, token string, context string, actor string)
| 996 | |
| 997 | // https://docs.bsky.app/docs/api/app-bsky-graph-get-follows |
| 998 | func GetFollows(pds string, token string, context string, actor string) (*FollowsTimeline, error) { |
| 999 | apiURL := pds + "/xrpc/app.bsky.graph.getFollows?actor=" + url.QueryEscape(actor) |
| 1000 | if context != "" { |
| 1001 | apiURL = pds + "/xrpc/app.bsky.graph.getFollows?actor=" + url.QueryEscape(actor) + "&cursor=" + context |
| 1002 | } |
| 1003 | |
| 1004 | resp, err := SendRequest(&token, http.MethodGet, apiURL, nil) |
| 1005 | if err != nil { |
| 1006 | return nil, err |
| 1007 | } |
| 1008 | defer resp.Body.Close() |
| 1009 | |
| 1010 | // // Print the response body for debugging |
| 1011 | // bodyBytes, _ := io.ReadAll(resp.Body) |
| 1012 | // bodyString := string(bodyBytes) |
| 1013 | // fmt.Println("Response Body:", bodyString) |
| 1014 | |
| 1015 | if resp.StatusCode != http.StatusOK { |
| 1016 | bodyBytes, _ := io.ReadAll(resp.Body) |
| 1017 | bodyString := string(bodyBytes) |
| 1018 | fmt.Println("Response Status:", resp.StatusCode) |
| 1019 | fmt.Println("Response Body:", bodyString) |
| 1020 | return nil, errors.New(bodyString) // return response |
| 1021 | } |
| 1022 | |
| 1023 | feeds := FollowsTimeline{} |
| 1024 | if err := json.NewDecoder(resp.Body).Decode(&feeds); err != nil { |
| 1025 | return nil, err |
| 1026 | } |
| 1027 | |
| 1028 | return &feeds, nil |
| 1029 | } |
| 1030 | |
| 1031 | // This handles both normal & replys |
| 1032 | func UpdateStatus(pds string, token string, my_did string, status string, in_reply_to *string, mentions []bridge.FacetParsing, urls []bridge.FacetParsing, tags []bridge.FacetParsing, imageBlob *Blob, imageRes []int) (*ThreadRoot, error) { |
nothing calls this directly
no test coverage detected