Skip to content

Commit

Permalink
Merge pull request #1475 from ag-wnl/fetch-following-timeline
Browse files Browse the repository at this point in the history
Fetch timeline for followed accounts via Twitter client methods
  • Loading branch information
shakkernerd authored Dec 26, 2024
2 parents a3adbef + d34598d commit f46b4f8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/client-twitter/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,14 @@ export class ClientBase extends EventEmitter {
return homeTimeline.tweets;
}

async fetchHomeTimeline(count: number): Promise<Tweet[]> {
/**
* Fetch timeline for twitter account, optionally only from followed accounts
*/
async fetchHomeTimeline(count: number, following?: boolean): Promise<Tweet[]> {
elizaLogger.debug("fetching home timeline");
const homeTimeline = await this.twitterClient.fetchHomeTimeline(
count,
[]
);
const homeTimeline = following
? await this.twitterClient.fetchFollowingTimeline(count, [])
: await this.twitterClient.fetchHomeTimeline(count, []);

elizaLogger.debug(homeTimeline, { depth: Infinity });
const processedTimeline = homeTimeline
Expand Down

0 comments on commit f46b4f8

Please sign in to comment.