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

Function UnfollowUser

twitterv1/user.go:351–372  ·  view source on GitHub ↗

https://web.archive.org/web/20120407201029/https://dev.twitter.com/docs/api/1/post/friendships/create

(c *fiber.Ctx, actor string)

Source from the content-addressed store, hash-verified

349
350// https://web.archive.org/web/20120407201029/https://dev.twitter.com/docs/api/1/post/friendships/create
351func UnfollowUser(c *fiber.Ctx, actor string) error {
352 // auth
353 my_did, pds, _, oauthToken, err := GetAuthFromReq(c)
354 if err != nil {
355 return MissingAuth(c, err)
356 }
357
358 // follow
359 user, err := blueskyapi.UnfollowUser(*pds, *oauthToken, actor, *my_did)
360
361 if err != nil {
362 fmt.Println("Error:", err)
363 return HandleBlueskyError(c, err.Error(), "app.bsky.graph.unfollow", func(c *fiber.Ctx) error {
364 return UnfollowUser(c, actor)
365 })
366 }
367
368 // convert user into twitter format
369 twitterUser := blueskyapi.AuthorTTB(*user)
370
371 return EncodeAndSend(c, twitterUser)
372}
373
374func UnfollowUserForm(c *fiber.Ctx) error {
375 // lets get the user params

Callers 2

UnfollowUserFormFunction · 0.70
UnfollowUserParamsFunction · 0.70

Calls 4

GetAuthFromReqFunction · 0.85
MissingAuthFunction · 0.85
HandleBlueskyErrorFunction · 0.85
EncodeAndSendFunction · 0.85

Tested by

no test coverage detected