Packages › trotsky › StepActorPosts
StepActorPosts class
Represents a step for retrieving an actor's posts using the Bluesky API. Supports paginated retrieval of posts.
Signature:
typescript
export declare class StepActorPosts<P = StepActor, C extends StepActorOutput = StepActorOutput, O extends StepActorPostsOutput = StepActorPostsOutput> extends StepPosts<P, C, O>Extends: StepPosts<P, C, O>
Example 1
Get an actor's recent posts:
ts
await Trotsky.init(agent)
.actor("bsky.app")
.posts()
.take(10)
.each()
.tap((step) => {
console.log(step.context.record.text)
})
.run()Example 2
Like an actor's popular posts:
ts
await Trotsky.init(agent)
.actor("alice.bsky.social")
.posts()
.take(50)
.each()
.when((step) => step?.context?.likeCount > 10)
.like()
.wait(1000)
.run()Methods
Method | Modifiers | Description |
|---|---|---|
Applies pagination to retrieve posts and sets the output. Fetches paginated results using the agent and appends them to the output. | ||
Generates query parameters for retrieving posts, including the optional cursor. |