Last active
December 26, 2015 03:38
-
-
Save tam17aki/7086913 to your computer and use it in GitHub Desktop.
Synthesize the number of unread tweets.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-after-load "speech-synth" | |
'(progn | |
(defun speech-synth-new-tweets () | |
(when (not (eq (length (twittering-current-timeline-data | |
twittering-new-tweets-spec)) | |
twittering-new-tweets-count)) | |
(let* ((buf-name (buffer-name (current-buffer))) | |
(num_new_tweets (+ (or (cadr (assq (get-buffer buf-name) | |
twittering-unread-status-info)) 0) | |
(length twittering-rendered-new-tweets)))) | |
(when (>= num_new_tweets 1) | |
(cond ((string= ":home" buf-name) | |
(speech-synth-execute-synthesis | |
(format "新着ツイートが%d件来ましたよ." num_new_tweets)))))))) | |
(add-hook 'twittering-new-tweets-rendered-hook | |
#'(lambda () (speech-synth-new-tweets))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment