add support for links as posts
This commit is contained in:
parent
2bb3946237
commit
bfa829d8c7
4 changed files with 240 additions and 33 deletions
|
@ -263,3 +263,17 @@ type Records struct {
|
|||
Cid string `json:"cid"`
|
||||
Value Value `json:"value"`
|
||||
}
|
||||
|
||||
func (bluesky *Bluesky) FetchPost(did string, rkey string) FetchedPost {
|
||||
resp := &struct {
|
||||
Posts []FetchedPost `json:"posts"`
|
||||
}{}
|
||||
params := struct {
|
||||
URIs string `url:"uris"`
|
||||
}{
|
||||
URIs: fmt.Sprintf("at://%s/app.bsky.feed.post/%s", did, rkey),
|
||||
}
|
||||
bluesky.sling.New().Base("https://public.api.bsky.app").
|
||||
Get("/xrpc/app.bsky.feed.getPosts").QueryStruct(¶ms).Receive(resp, resp)
|
||||
return resp.Posts[0]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue