TwIt et l'historique
Un autre truc que j’aimes avec certains clients Identica/Twitter c’est le fait qu’ils vous ramènent là où vous en étiez la dernière fois que vous avez lu les tweets. Pour faire la même chose avec TwIt, j’ai ajouté une fonction (dirty hack comme on dis) permettant de bookmarker un Tweet (sauvegarder son id/status twit-save-id-at-point) et une fonction permettant de charger les tweets depuis l’id bookmarqué twit-show-recent-tweets-from-last-id. La touche q qui est utilisé par défaut pour quitter est remplacée par une fonction twit-quit qui sauvegarde le tweet actuel avant d’invoquer burry-buffer:
("W" . twit-save-id-at-point) ("q" . twit-quit) (defconst twit-friend-timeline-file-from-last-id (concat twit-base-url "/statuses/friends_timeline.xml?count=200&since_id=%s"))
(defun twit-save-id-at-point () (interactive) (setq twit-id (twit-get-text-property 'twit-id)) " Let's store this in a file so we can start it from here next time" (write-region twit-id nil "~/.twit-last-id") ) (defun twit-quit () " Let' do some pre-hook before burying the buffer" (interactive) (twit-save-id-at-point) (bury-buffer) ) (defun twit-show-recent-tweets-from-last-id (&optional page) (interactive "P") (setq page (twit-check-page-prefix page)) (with-temp-buffer (setq retval (insert-file-contents "~/.twit-last-id") ) (setq twit-id (buffer-string))) (pop-to-buffer (with-twit-buffer "*Twit-recent*" (twit-write-title "Recent Tweets (Page %s) [%s]\n" page (format-time-string "%c")) (twit-write-recent-tweets (twit-parse-xml (format twit-friend-timeline-\ file-from-last-id twit-id) "GET")))))
Trouvez le module patché ici