From 72a69d6958f7df9ad54f73b53bc64b6709ccc28f Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 13 Jan 2025 09:26:16 +1100 Subject: Show expanded text in longer posts --- exitter.el | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'exitter.el') diff --git a/exitter.el b/exitter.el index e40fc50..3334e73 100644 --- a/exitter.el +++ b/exitter.el @@ -492,7 +492,7 @@ ONEPLUS A3010 Build/PKQ1.181203.001)") (defun exitter-filter-tweet-result (result) (pcase (alist-get '__typename result) ("Tweet" - (let (ret author quoted) + (let (ret author quoted post) (let-alist result (let-alist .core.user_results.result.legacy (setq author @@ -502,21 +502,24 @@ ONEPLUS A3010 Build/PKQ1.181203.001)") (setq quoted (exitter-filter-tweet-result .quoted_status_result.result))) (let-alist .legacy - (push - `(post . - ((id_str . ,.id_str) - (created_at . ,.created_at) - (full_text . ,.full_text) - (urls . ,(vconcat .entities.urls .entities.media)) - (reply_count . ,.reply_count) - (retweet_count . ,.retweet_count) - (quote_count . ,.quote_count) - (favorite_count . ,.favorite_count) - (in_reply_to_status_id_str . ,.in_reply_to_status_id_str) - (is_quote_status . ,.is_quote_status) - (author . ,author) - (quoted . ,quoted))) - ret)) + (setq post + `((id_str . ,.id_str) + (created_at . ,.created_at) + (full_text . ,.full_text) + (urls . ,(vconcat .entities.urls .entities.media)) + (reply_count . ,.reply_count) + (retweet_count . ,.retweet_count) + (quote_count . ,.quote_count) + (favorite_count . ,.favorite_count) + (in_reply_to_status_id_str . ,.in_reply_to_status_id_str) + (is_quote_status . ,.is_quote_status) + (author . ,author) + (quoted . ,quoted)))) + (when .note_tweet.is_expandable + (let-alist .note_tweet.note_tweet_results.result + (push `(expanded_text . ,.text) post) + (push `(extra_urls . ,.entity_set.urls) post))) + (push `(post . ,post) ret) ) ret)) ("TweetWithVisibilityResults" @@ -564,7 +567,8 @@ Including ancestors and descendants, if any." .author.name .author.screen_name (exitter--relative-time-description .created_at) - (exitter-replace-t-co-links .full_text .urls) + (exitter-replace-t-co-links (or .expanded_text .full_text) + (or .extra_urls .urls)) (if .quoted (format "\n\n----\n%s----" (replace-regexp-in-string -- cgit v1.2.3