|
@@ -493,7 +493,10 @@ ONEPLUS A3010 Build/PKQ1.181203.001)")
|
|
|
(alist-get
|
|
(alist-get
|
|
|
'entries
|
|
'entries
|
|
|
(let-alist resp
|
|
(let-alist resp
|
|
|
- (elt .data.threaded_conversation_with_injections_v2.instructions 0))))))
|
|
|
|
|
|
|
+ (seq-find
|
|
|
|
|
+ (lambda (ins)
|
|
|
|
|
+ (equal (alist-get 'type ins) "TimelineAddEntries"))
|
|
|
|
|
+ .data.threaded_conversation_with_injections_v2.instructions))))))
|
|
|
|
|
|
|
|
;;; .content.entryType == "TimelineTimelineItem":
|
|
;;; .content.entryType == "TimelineTimelineItem":
|
|
|
|
|
|
|
@@ -566,6 +569,8 @@ ONEPLUS A3010 Build/PKQ1.181203.001)")
|
|
|
ret))
|
|
ret))
|
|
|
("TweetWithVisibilityResults"
|
|
("TweetWithVisibilityResults"
|
|
|
(message "Aaaaaaads"))
|
|
(message "Aaaaaaads"))
|
|
|
|
|
+ ("TweetTombstone"
|
|
|
|
|
+ (message (let-alist result .tombstone.text.text)))
|
|
|
(_
|
|
(_
|
|
|
(error "result with unknown __typename: %s" result))))
|
|
(error "result with unknown __typename: %s" result))))
|
|
|
|
|
|
|
@@ -598,11 +603,16 @@ Including ancestors and descendants, if any."
|
|
|
(defvar exitter-dir (locate-user-emacs-file "exitter")
|
|
(defvar exitter-dir (locate-user-emacs-file "exitter")
|
|
|
"Path to local directory of saved threads.")
|
|
"Path to local directory of saved threads.")
|
|
|
|
|
|
|
|
|
|
+(defun exitter-post-file-name (id)
|
|
|
|
|
+ (format (file-name-concat exitter-dir (format "%s.org" id))))
|
|
|
|
|
+
|
|
|
(defun exitter-save-posts (filtered-details id)
|
|
(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 (file-name-concat exitter-dir (format "%s.org" id)))))
|
|
|
|
|
|
|
+ (if (length= filtered-details 0)
|
|
|
|
|
+ (message "Empty filtered-details - will not save.")
|
|
|
|
|
+ (exitter-save-text-and-switch-to-buffer
|
|
|
|
|
+ (exitter-format-posts filtered-details)
|
|
|
|
|
+ (exitter-post-file-name id))))
|
|
|
|
|
|
|
|
(defun exitter-post-url (user post-id)
|
|
(defun exitter-post-url (user post-id)
|
|
|
(format "https://x.com/%s/status/%s" user post-id))
|
|
(format "https://x.com/%s/status/%s" user post-id))
|
|
@@ -644,12 +654,16 @@ Including ancestors and descendants, if any."
|
|
|
(string-match-p "^/[^/]+/status/\\([0-9]+\\)"
|
|
(string-match-p "^/[^/]+/status/\\([0-9]+\\)"
|
|
|
(url-filename (url-generic-parse-url url))))
|
|
(url-filename (url-generic-parse-url url))))
|
|
|
|
|
|
|
|
-(defun exitter-open-post (url)
|
|
|
|
|
- (interactive "sTwitter link: ")
|
|
|
|
|
|
|
+(defun exitter-open-post (url &optional arg)
|
|
|
|
|
+ (interactive "sTwitter link: \nP")
|
|
|
(let ((path-etc (url-filename (url-generic-parse-url url))))
|
|
(let ((path-etc (url-filename (url-generic-parse-url url))))
|
|
|
(unless (string-match "^/[^/]+/status/\\([0-9]+\\)" path-etc)
|
|
(unless (string-match "^/[^/]+/status/\\([0-9]+\\)" path-etc)
|
|
|
(error "Not a valid x/twitter (or a frontend) url!"))
|
|
(error "Not a valid x/twitter (or a frontend) url!"))
|
|
|
- (exitter-get-tweet (match-string 1 path-etc))))
|
|
|
|
|
|
|
+ (let* ((id (match-string 1 path-etc))
|
|
|
|
|
+ (file-name (exitter-post-file-name id)))
|
|
|
|
|
+ (if (or arg (not (file-exists-p file-name)))
|
|
|
|
|
+ (exitter-get-tweet (match-string 1 path-etc))
|
|
|
|
|
+ (find-file file-name)))))
|
|
|
|
|
|
|
|
;;; utilities
|
|
;;; utilities
|
|
|
|
|
|