feat: Implement search tweets trigger

This commit is contained in:
Faruk AYDIN
2022-08-31 15:28:53 +03:00
committed by Ali BARIN
parent 81a444e056
commit abaad7cb82
6 changed files with 107 additions and 60 deletions

View File

@@ -0,0 +1,26 @@
import TwitterClient from '../client';
export default class SearchTweets {
client: TwitterClient;
constructor(client: TwitterClient) {
this.client = client;
}
async run(lastInternalId: string) {
return this.getTweets(lastInternalId);
}
async testRun() {
return this.getTweets();
}
async getTweets(lastInternalId?: string) {
const tweets = await this.client.searchTweets.run(
this.client.step.parameters.searchTerm as string,
lastInternalId
);
return tweets;
}
}