Skip to content

Commit a3f69df

Browse files
Aaron1011romeoscript
authored andcommitted
feat: expose getUserTweetsV2 in Scraper class (#47)
1 parent c61468d commit a3f69df

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/scraper.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {
5252
getTweetsByUserId,
5353
getLikedTweets,
5454
getBookmarksV2,
55+
getUserTweetsV2,
5556
TweetQuery,
5657
getTweet,
5758
fetchListTweets,
@@ -594,6 +595,16 @@ export class Scraper {
594595
return searchTweetsV2(query, maxResults, this.auth);
595596
}
596597

598+
/**
599+
* Fetch tweets from a user using the v2 API.
600+
* @param userId The user ID whose tweets should be returned.
601+
* @param maxResults The maximum number of results to return per request.
602+
* @returns A promise that resolves to a paginator of tweets.
603+
*/
604+
public getUserTweetsV2(userId: string, maxResults: number) {
605+
return getUserTweetsV2(userId, maxResults, this.auth);
606+
}
607+
597608
/**
598609
* Fetches tweets from a Twitter user.
599610
* @param user The user whose tweets should be returned.

0 commit comments

Comments
 (0)