MCPcopy Index your code
hub / github.com/Preloading/TwitterAPIBridge / GetUserInfoRaw

Function GetUserInfoRaw

bluesky/blueskyapi.go:478–500  ·  view source on GitHub ↗
(pds string, token string, screen_name string)

Source from the content-addressed store, hash-verified

476}
477
478func GetUserInfoRaw(pds string, token string, screen_name string) (*User, error) {
479 url := pds + "/xrpc/app.bsky.actor.getProfile" + "?actor=" + screen_name
480
481 resp, err := SendRequest(&token, http.MethodGet, url, nil)
482 if err != nil {
483 return nil, err
484 }
485 defer resp.Body.Close()
486 if resp.StatusCode != http.StatusOK {
487 bodyBytes, _ := io.ReadAll(resp.Body)
488 bodyString := string(bodyBytes)
489 fmt.Println("Response Status:", resp.StatusCode)
490 fmt.Println("Response Body:", bodyString)
491 return nil, errors.New(bodyString) // return response
492 }
493
494 author := User{}
495 if err := json.NewDecoder(resp.Body).Decode(&author); err != nil {
496 return nil, err
497 }
498
499 return &author, nil
500}
501
502func GetUsersInfo(pds string, token string, items []string, ignoreCache bool) ([]*bridge.TwitterUser, error) {
503 var results []*bridge.TwitterUser

Callers 2

FollowUserFunction · 0.85
UnfollowUserFunction · 0.85

Calls 1

SendRequestFunction · 0.85

Tested by

no test coverage detected