summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2025-01-13 09:47:58 +1100
committerYuchen Pei <id@ypei.org>2025-01-13 09:47:58 +1100
commit211159547e25bf9aee68b2fd573df6c3b1bfa7b9 (patch)
tree9923e7ae152543fe10065529840f1697d16c6c14
parent72a69d6958f7df9ad54f73b53bc64b6709ccc28f (diff)
Add link to timestamp
-rw-r--r--exitter.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/exitter.el b/exitter.el
index 3334e73..ea9f5c6 100644
--- a/exitter.el
+++ b/exitter.el
@@ -554,11 +554,17 @@ Including ancestors and descendants, if any."
"\n")))
(defun exitter-save-posts (filtered-details id)
- (pp filtered-details)
+ ;; (pp filtered-details)
(exitter-save-text-and-switch-to-buffer
(exitter-format-posts filtered-details)
(format "~/Downloads/%s.org" id)))
+(defun exitter-post-url (user post-id)
+ (format "https://x.com/%s/status/%s" user post-id))
+
+(defun exitter-make-org-link (link desc)
+ (format "[[%s][%s]]" link desc))
+
(defun exitter-format-post (post level)
"Format a POST with indent LEVEL."
(let-alist post
@@ -566,7 +572,9 @@ Including ancestors and descendants, if any."
(make-string level ?*)
.author.name
.author.screen_name
- (exitter--relative-time-description .created_at)
+ (exitter-make-org-link
+ (exitter-post-url .author.screen_name .id_str)
+ (exitter--relative-time-description .created_at))
(exitter-replace-t-co-links (or .expanded_text .full_text)
(or .extra_urls .urls))
(if .quoted