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

Function GetOthersSuggestedUsers

bluesky/blueskyapi.go:1914–1941  ·  view source on GitHub ↗
(pds string, token string, limit int, actor string)

Source from the content-addressed store, hash-verified

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
1916
1917 resp, err := SendRequest(&token, http.MethodGet, url, nil)
1918 if err != nil {
1919 return nil, err
1920 }
1921 defer resp.Body.Close()
1922
1923 // // Print the response body
1924 // bodyBytes, _ := io.ReadAll(resp.Body)
1925 // bodyString := string(bodyBytes)
1926 // fmt.Println("Response Body:", bodyString)
1927
1928 if resp.StatusCode != http.StatusOK {
1929 bodyBytes, _ := io.ReadAll(resp.Body)
1930 bodyString := string(bodyBytes)
1931 fmt.Println("Response Status:", resp.StatusCode)
1932 fmt.Println("Response Body:", bodyString)
1933 return nil, errors.New(bodyString) // return response
1934 }
1935
1936 users := OtherActorSuggestions{}
1937 if err := json.NewDecoder(resp.Body).Decode(&users); err != nil {
1938 return nil, err
1939 }
1940 return users.Actors, nil
1941}
1942
1943func GetNotifications(pds string, token string, limit int, context string) (*Notifications, error) {
1944 url := pds + "/xrpc/app.bsky.notification.listNotifications?limit=" + fmt.Sprintf("%d", limit)

Callers

nothing calls this directly

Calls 1

SendRequestFunction · 0.85

Tested by

no test coverage detected