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

Function AuthorTTB

bluesky/blueskyapi.go:655–711  ·  view source on GitHub ↗

https://web.archive.org/web/20121029153120/https://dev.twitter.com/docs/platform-objects/users

(author User)

Source from the content-addressed store, hash-verified

653
654// https://web.archive.org/web/20121029153120/https://dev.twitter.com/docs/platform-objects/users
655func AuthorTTB(author User) *bridge.TwitterUser {
656 id := bridge.BlueSkyToTwitterID(author.DID)
657 pfp_url := configData.CdnURL + "/cdn/img/?url=" + url.QueryEscape(author.Avatar) + ":profile_bigger"
658 banner_url := ""
659 if author.Banner != "" {
660 banner_components := strings.Split(author.Banner, "/")
661
662 if len(banner_components) >= 8 {
663 banner_component_blob := strings.Split(banner_components[7], "@")
664 banner_url = configData.CdnURL + "/cdn/img/bsky/" + banner_components[6] + "/" + banner_component_blob[0] + ".png"
665 }
666 }
667 user := &bridge.TwitterUser{
668 ProfileSidebarFillColor: "e0ff92",
669 Name: func() string {
670 if author.DisplayName == "" {
671 return author.Handle
672 }
673 return author.DisplayName
674 }(),
675 ProfileSidebarBorderColor: "87bc44",
676 ProfileBackgroundTile: false,
677 CreatedAt: bridge.TwitterTimeConverter(author.CreatedAt.Time),
678 ProfileImageURLHttps: pfp_url,
679 ProfileImageURL: pfp_url,
680
681 ProfileUseBackgroundImage: false,
682
683 ProfileBannerURL: banner_url,
684 ProfileBannerURLHttps: banner_url,
685
686 Location: "",
687 ProfileLinkColor: "0000ff",
688 IsTranslator: false,
689 ContributorsEnabled: false,
690 URL: "",
691 UtcOffset: nil,
692 ID: *id,
693 IDStr: strconv.FormatInt(*id, 10),
694 ListedCount: 0,
695 ProfileTextColor: "000000",
696 Protected: false,
697
698 Lang: "en",
699 Notifications: nil,
700 Verified: author.Verification.VerifiedStatus == "valid",
701 ProfileBackgroundColor: "c0deed",
702 GeoEnabled: false,
703 Description: author.Description,
704 FriendsCount: author.FollowsCount,
705 FollowersCount: author.FollowersCount,
706 StatusesCount: author.PostsCount,
707 //FavouritesCount: author.,
708 ScreenName: author.Handle,
709 }
710 return user
711}
712

Callers 2

GetUserInfoFunction · 0.85
GetUsersInfoFunction · 0.85

Calls 2

BlueSkyToTwitterIDFunction · 0.92
TwitterTimeConverterFunction · 0.92

Tested by

no test coverage detected