MCPcopy Create free account
hub / github.com/Preloading/TwitterAPIBridge / GetTopicSuggestedUsers

Function GetTopicSuggestedUsers

bluesky/blueskyapi.go:1885–1912  ·  view source on GitHub ↗
(pds string, token string, limit int, category string)

Source from the content-addressed store, hash-verified

1883}
1884
1885func GetTopicSuggestedUsers(pds string, token string, limit int, category string) ([]User, error) {
1886 url := pds + "/xrpc/app.bsky.unspecced.getSuggestedUsers?limit=" + fmt.Sprintf("%d", limit) + "&category=" + category
1887
1888 resp, err := SendRequest(&token, http.MethodGet, url, nil)
1889 if err != nil {
1890 return nil, err
1891 }
1892 defer resp.Body.Close()
1893
1894 // // Print the response body
1895 // bodyBytes, _ := io.ReadAll(resp.Body)
1896 // bodyString := string(bodyBytes)
1897 // fmt.Println("Response Body:", bodyString)
1898
1899 if resp.StatusCode != http.StatusOK {
1900 bodyBytes, _ := io.ReadAll(resp.Body)
1901 bodyString := string(bodyBytes)
1902 fmt.Println("Response Status:", resp.StatusCode)
1903 fmt.Println("Response Body:", bodyString)
1904 return nil, errors.New(bodyString) // return response
1905 }
1906
1907 users := UserSearchResult{}
1908 if err := json.NewDecoder(resp.Body).Decode(&users); err != nil {
1909 return nil, err
1910 }
1911 return users.Actors, nil
1912}
1913
1914func GetOthersSuggestedUsers(pds string, token string, limit int, actor string) ([]User, error) {
1915 url := pds + "/xrpc/app.bsky.graph.getSuggestedFollowsByActor?limit=" + fmt.Sprintf("%d", limit) + "&actor=" + actor

Callers

nothing calls this directly

Calls 1

SendRequestFunction · 0.85

Tested by

no test coverage detected