Skip to content

Commit

Permalink
add more timeline specification.
Browse files Browse the repository at this point in the history
  • Loading branch information
yata committed Dec 22, 2009
1 parent 52ed20f commit 8988155
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Expand Up @@ -245,6 +245,11 @@
(twittering-http-application-headers):
`Content-Length' is added to `headers'.

2009-12-22 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-get-host-method-from-timeline-spec)
(twittering-get-timeline-spec): Add more timeline specification.

2009-12-20 Tadashi Matsuo <tad@mymail.twin.jp>

* test/test-twittering-mode.el (timeline-spec): add tests for
Expand Down
15 changes: 15 additions & 0 deletions twittering-mode.el
Expand Up @@ -451,6 +451,7 @@ Otherwise, they are retrieved by `url-retrieve'.")
(cond
((string= "statuses/friends_timeline" method) "~")
((string= "statuses/replies" method) "@")
((string= "statuses/mentions" method) "M")
((string= "statuses/public_timeline" method) "-")
((string= "statuses/user_timeline" method) (twittering-get-username))
((string-match "^statuses/user_timeline/\\(.+\\)$" method)
Expand All @@ -462,6 +463,10 @@ Otherwise, they are retrieved by `url-retrieve'.")
(let ((username (match-string-no-properties 1 method))
(listname (match-string-no-properties 2 method)))
(concat username "/" listname)))
((string= "1/statuses/home_timeline" method) "H")
((string= "1/statuses/retweeted_by_me" method) "B")
((string= "1/statuses/retweeted_to_me" method) "T")
((string= "1/statuses/retweets_of_me" method) "O")
(t nil)))
(t nil))))

Expand All @@ -475,11 +480,21 @@ Otherwise, they are retrieved by `url-retrieve'.")
'("twitter.com" "statuses/public_timeline"))
((string-match "^@$" timeline-spec)
'("twitter.com" "statuses/replies"))
((string-match "^M$" timeline-spec)
'("twitter.com" "statuses/mentions"))
((string-match "^\\([^/]+\\)/\\([^/]+\\)$" timeline-spec)
(let ((username (match-string 1 timeline-spec))
(list-name (match-string 2 timeline-spec)))
`("api.twitter.com"
,(concat "1/" username "/lists/" list-name "/statuses" ))))
((string-match "^H$" timeline-spec)
'("api.twitter.com" "1/statuses/home_timeline"))
((string-match "^B$" timeline-spec)
'("api.twitter.com" "1/statuses/retweeted_by_me"))
((string-match "^T$" timeline-spec)
'("api.twitter.com" "1/statuses/retweeted_to_me"))
((string-match "^O$" timeline-spec)
'("api.twitter.com" "1/statuses/retweets_of_me"))
(t
`("twitter.com" ,(concat "statuses/user_timeline/" timeline-spec)))))

Expand Down

0 comments on commit 8988155

Please sign in to comment.