Skip to content

Commit

Permalink
'twittering-get-and-render-timeline' accepts a timeline spec string.
Browse files Browse the repository at this point in the history
  • Loading branch information
cvmat committed Jan 5, 2010
1 parent 088d42b commit de5875d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -12,6 +12,8 @@
(twittering-extract-timeline-spec): support timeline spec
bookmark.
(twittering-equal-string-as-timeline): add.
(twittering-get-and-render-timeline): accept a timeline spec
string as well as a S-expression.

* test/test-twittering-mode.el (timeline-spec): add tests of
timeline spec normalization.
Expand Down
34 changes: 22 additions & 12 deletions twittering-mode.el
Expand Up @@ -1923,18 +1923,28 @@ following symbols;
))

(defun twittering-get-and-render-timeline (spec &optional noninteractive id)
(unless (equal spec twittering-last-retrieved-timeline-spec)
(setq twittering-timeline-last-update nil
twittering-timeline-data nil
twittering-last-requested-timeline-spec spec))
(if (twittering-timeline-spec-primary-p spec)
(let ((pair (twittering-timeline-spec-to-host-method spec)))
(when pair
(let ((host (car pair))
(method (cadr pair)))
(twittering-get-twits host method noninteractive id))))
(let ((type (car spec)))
(error (format "%s has not been supported yet." type)))))
(let* ((original-spec spec)
(spec-string (if (stringp spec)
spec
(twittering-timeline-spec-to-string spec)))
(spec ;; normalized spec.
(twittering-string-to-timeline-spec spec-string)))
(when (null spec)
(error
(format "\"%s\" is invalid as a timeline spec."
(or spec-string original-spec))))
(unless (equal spec twittering-last-retrieved-timeline-spec)
(setq twittering-timeline-last-update nil
twittering-timeline-data nil
twittering-last-requested-timeline-spec spec))
(if (twittering-timeline-spec-primary-p spec)
(let ((pair (twittering-timeline-spec-to-host-method spec)))
(when pair
(let ((host (car pair))
(method (cadr pair)))
(twittering-get-twits host method noninteractive id))))
(let ((type (car spec)))
(error (format "%s has not been supported yet." type))))))

(defun twittering-retrieve-image (images)
(if twittering-use-wget
Expand Down

0 comments on commit de5875d

Please sign in to comment.