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

Function media_timeline

twitterv1/post_viewing.go:56–74  ·  view source on GitHub ↗
(c *fiber.Ctx)

Source from the content-addressed store, hash-verified

54}
55
56func media_timeline(c *fiber.Ctx) error {
57 actor := c.Query("screen_name")
58 if actor == "" {
59 actor = c.Query("user_id")
60 if actor == "" {
61 return ReturnError(c, "No user provided", 195, fiber.StatusForbidden)
62 }
63 actorInt, err := strconv.ParseInt(actor, 10, 64)
64 if err != nil {
65 return ReturnError(c, "Invalid user_id provided", 195, fiber.StatusForbidden)
66 }
67 actorPtr, err := bridge.TwitterIDToBlueSky(&actorInt)
68 if err != nil {
69 return ReturnError(c, "Invalid user_id provided", 195, fiber.StatusForbidden)
70 }
71 actor = *actorPtr
72 }
73 return convert_timeline(c, actor, false, blueskyapi.GetMediaTimeline)
74}
75
76func likes_timeline(c *fiber.Ctx) error {
77 // We shall pretend that the only thing it can be is a user id. TODO: maybe rectify this later

Callers

nothing calls this directly

Calls 3

TwitterIDToBlueSkyFunction · 0.92
ReturnErrorFunction · 0.85
convert_timelineFunction · 0.85

Tested by

no test coverage detected