diff --git a/src/timeline-v1.ts b/src/timeline-v1.ts index e35b97fc..d724b2a4 100644 --- a/src/timeline-v1.ts +++ b/src/timeline-v1.ts @@ -104,6 +104,7 @@ export interface TimelineResultRaw { } export interface LegacyTweetRaw { + bookmark_count?: number; conversation_id_str?: string; created_at?: string; favorite_count?: number; diff --git a/src/timeline-v2.ts b/src/timeline-v2.ts index 73c54f0d..e37fab8d 100644 --- a/src/timeline-v2.ts +++ b/src/timeline-v2.ts @@ -142,6 +142,7 @@ export function parseLegacyTweet( const { photos, videos, sensitiveContent } = parseMediaGroups(media); const tw: Tweet = { + bookmarkCount: tweet.bookmark_count, conversationId: tweet.conversation_id_str, id: tweet.id_str, hashtags: hashtags diff --git a/src/tweets.test.ts b/src/tweets.test.ts index 21eee504..e9c1d1ba 100644 --- a/src/tweets.test.ts +++ b/src/tweets.test.ts @@ -36,6 +36,7 @@ test('scraper can get tweet', async () => { delete actual?.replies; delete actual?.retweets; delete actual?.views; + delete actual?.bookmarkCount; expect(actual).toEqual(expected); }); @@ -166,6 +167,7 @@ test('scraper can get tweet quotes without logging in', async () => { delete quote?.quotedStatus?.replies; delete quote?.quotedStatus?.retweets; delete quote?.quotedStatus?.views; + delete quote?.quotedStatus?.bookmarkCount; expect(quote?.quotedStatus).toEqual(expected); }); @@ -207,6 +209,7 @@ test('scraper can get tweet quotes and replies', async () => { delete quote?.quotedStatus?.replies; delete quote?.quotedStatus?.retweets; delete quote?.quotedStatus?.views; + delete quote?.quotedStatus?.bookmarkCount; expect(quote?.quotedStatus).toEqual(expected); const reply = await scraper.getTweet('1237111868445134850'); @@ -218,6 +221,7 @@ test('scraper can get tweet quotes and replies', async () => { delete reply?.inReplyToStatus?.replies; delete reply?.inReplyToStatus?.retweets; delete reply?.inReplyToStatus?.views; + delete reply?.inReplyToStatus?.bookmarkCount; expect(reply?.inReplyToStatus).toEqual(expected); }); @@ -260,6 +264,7 @@ test('scraper can get retweet', async () => { delete retweet?.retweetedStatus?.replies; delete retweet?.retweetedStatus?.retweets; delete retweet?.retweetedStatus?.views; + delete retweet?.retweetedStatus?.bookmarkCount; expect(retweet?.retweetedStatus).toEqual(expected); }); @@ -295,6 +300,7 @@ test('scraper can get tweet views', async () => { delete actual?.replies; delete actual?.retweets; delete actual?.views; + delete actual?.bookmarkCount; expect(actual).toEqual(expected); }); diff --git a/src/tweets.ts b/src/tweets.ts index c53d04b6..0bd7cddd 100644 --- a/src/tweets.ts +++ b/src/tweets.ts @@ -49,6 +49,7 @@ export interface PlaceRaw { * A parsed Tweet object. */ export interface Tweet { + bookmarkCount?: number; conversationId?: string; hashtags: string[]; html?: string;