feat: Implement draft version of pagination with user tweet trigger
This commit is contained in:
@@ -7,24 +7,19 @@ export default class UserTweet {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async run() {
|
||||
return this.getTweets();
|
||||
async run(lastInternalId: string) {
|
||||
return this.getTweets(lastInternalId);
|
||||
}
|
||||
|
||||
async testRun() {
|
||||
return this.getTweets();
|
||||
}
|
||||
|
||||
async getTweets() {
|
||||
const userResponse = await this.client.getUserByUsername.run(
|
||||
async getTweets(lastInternalId?: string) {
|
||||
const user = await this.client.getUserByUsername.run(
|
||||
this.client.step.parameters.username as string
|
||||
);
|
||||
|
||||
const userId = userResponse.data.data.id;
|
||||
|
||||
const tweetsResponse = await this.client.getUserTweets.run(userId);
|
||||
const tweets = tweetsResponse.data.data;
|
||||
|
||||
return tweets;
|
||||
return await this.client.getUserTweets.run(user.id, lastInternalId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user