diff --git a/src/cli/shared.ts b/src/cli/shared.ts index 475aefd..3e91d8b 100644 --- a/src/cli/shared.ts +++ b/src/cli/shared.ts @@ -323,10 +323,10 @@ export function createCliContext(normalizedArgs: string[], env: NodeJS.ProcessEn // Display tweet text, with article indicator if present if (tweet.article) { - // For articles: show preview if text is just the title (home timeline), - // otherwise show full text (single tweet detail) - const isFullBody = tweet.text.length > tweet.article.title.length + 50; - if (isFullBody) { + // Full body mode: text starts with article title (from extractArticleText) + // Preview mode: text is short tweet intro that doesn't start with title + const hasFullBody = tweet.text.startsWith(tweet.article.title); + if (hasFullBody) { console.log(`📰 ${tweet.text}`); } else { console.log(`📰 ${tweet.article.title}`); @@ -356,6 +356,13 @@ export function createCliContext(normalizedArgs: string[], env: NodeJS.ProcessEn for (const line of truncated.split('\n').slice(0, 4)) { console.log(`│ ${line}`); } + // Display quoted tweet media + if (tweet.quotedTweet.media && tweet.quotedTweet.media.length > 0) { + for (const m of tweet.quotedTweet.media) { + const label = m.type === 'video' ? '🎬' : m.type === 'animated_gif' ? '🔄' : '🖼️'; + console.log(`│ ${label} ${m.url}`); + } + } console.log(`└─ https://x.com/${tweet.quotedTweet.author.username}/status/${tweet.quotedTweet.id}`); } diff --git a/src/lib/twitter-client-types.ts b/src/lib/twitter-client-types.ts index dca792c..01c02e8 100644 --- a/src/lib/twitter-client-types.ts +++ b/src/lib/twitter-client-types.ts @@ -80,9 +80,12 @@ export type GraphqlTweetResult = { }; }; article?: { + title?: string; + preview_text?: string; article_results?: { result?: { title?: string; + preview_text?: string; plain_text?: string; text?: string; richtext?: { diff --git a/src/lib/twitter-client-utils.ts b/src/lib/twitter-client-utils.ts index 6ca6275..daf049a 100644 --- a/src/lib/twitter-client-utils.ts +++ b/src/lib/twitter-client-utils.ts @@ -168,10 +168,7 @@ export function extractArticleMetadata( } // preview_text is available in home timeline responses - const previewText = firstText( - (articleResult as { preview_text?: string }).preview_text, - (article as { preview_text?: string }).preview_text, - ); + const previewText = firstText(articleResult.preview_text, article.preview_text); return { title, previewText }; }