summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2025-01-13 09:26:16 +1100
committerYuchen Pei <id@ypei.org>2025-01-13 09:26:16 +1100
commit72a69d6958f7df9ad54f73b53bc64b6709ccc28f (patch)
tree20d15961f5e6a06233910a49b283d691ad300ce9
parente0aa1eb8b5dd2696f92f90348cb9e8aedd798008 (diff)
Show expanded text in longer posts
-rw-r--r--exitter.el38
1 files changed, 21 insertions, 17 deletions
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