Skip to content

Commit

Permalink
replace '-' with '_' in symbol name 'direct-messages' and 'direct-mes…
Browse files Browse the repository at this point in the history
…sages-sent' to fit the parameters of twitter API.
  • Loading branch information
yata committed Feb 17, 2010
1 parent 3971a33 commit 3f0c2b6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Expand Up @@ -9,6 +9,16 @@
(twittering-jojo-mode): Likewise.
(twittering-toggle-reverse-mode): Likewise.

2010-02-16 Satoshi Yatagawa <yata_github@y.hauN.org>

* twittering-mode.el (twittering-timeline-spec-to-string): Replace
`-' with `_' in symbol name `direct-messages' and
`direct-messages-sent' to fit the parameters of twitter API.
(twittering-extract-timeline-spec): Likewise.
(twittering-timeline-spec-primary-p): Likewise.
(twittering-timeline-spec-to-host-method): Likewise.
(twittering-timeline-spec-alias): Likewise in a comment.

2010-02-16 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-get-first-status-head): return
Expand Down
28 changes: 14 additions & 14 deletions twittering-mode.el
Expand Up @@ -142,15 +142,15 @@ For the style \"$NAME(ARG)\", the function is called with a string ARG.
For example, if you specify
'((\"FRIENDS\" . \"(USER1+USER2+USER3)\")
(\"to_me\" . \"(:mentions+:retweets_of_me+:direct-messages)\")
(\"to_me\" . \"(:mentions+:retweets_of_me+:direct_messages)\")
(\"related-to\" .
,(lambda (username)
(if username
(format \":search/to:%s OR from:%s OR @%s/\"
username username username)
\":home\")))),
then you can use \"$to_me\" as
\"(:mentions+:retweets_of_me+:direct-messages)\".")
\"(:mentions+:retweets_of_me+:direct_messages)\".")

(defvar twittering-current-timeline-spec-string nil
"The current timeline spec string. This variable should not be referred
Expand Down Expand Up @@ -605,8 +605,8 @@ as a list of a string on Emacs21."
;;; - (list USER LIST):
;;; the list LIST of the user USER. LIST and USER are strings.
;;;
;;; - (direct-messages): received direct messages.
;;; - (direct-messages-sent): sent direct messages.
;;; - (direct_messages): received direct messages.
;;; - (direct_messages_sent): sent direct messages.
;;; - (friends): friends timeline.
;;; - (home): home timeline.
;;; - (mentions): mentions timeline.
Expand All @@ -626,7 +626,7 @@ as a list of a string on Emacs21."
;;; Timeline spec string
;;;
;;; SPEC ::= PRIMARY | COMPOSITE
;;; PRIMARY ::= USER | LIST | DIRECT-MESSSAGES | DIRECT-MESSSAGES-SENT
;;; PRIMARY ::= USER | LIST | DIRECT_MESSSAGES | DIRECT_MESSSAGES_SENT
;;; | FRIENDS | HOME | MENTIONS | PUBLIC | REPLIES
;;; | RETWEETED_BY_ME | RETWEETED_TO_ME | RETWEETS_OF_ME
;;; | SEARCH
Expand All @@ -635,8 +635,8 @@ as a list of a string on Emacs21."
;;; USER ::= /[a-zA-Z0-9_-]+/
;;; LIST ::= USER "/" LISTNAME
;;; LISTNAME ::= /[a-zA-Z0-9_-]+/
;;; DIRECT-MESSSAGES ::= ":direct-messages"
;;; DIRECT-MESSSAGES-SENT ::= ":direct-messages-sent"
;;; DIRECT_MESSSAGES ::= ":direct_messages"
;;; DIRECT_MESSSAGES_SENT ::= ":direct_messages_sent"
;;; FRIENDS ::= ":friends"
;;; HOME ::= ":home" | "~"
;;; MENTIONS ::= ":mentions"
Expand Down Expand Up @@ -664,8 +664,8 @@ If SHORTEN is non-nil, the abbreviated expression will be used."
;; list
((eq type 'list) (concat (car value) "/" (cadr value)))
;; simple
((eq type 'direct-messages) ":direct-messages")
((eq type 'direct-messages-sent) ":direct-messages-sent")
((eq type 'direct_messages) ":direct_messages")
((eq type 'direct_messages_sent) ":direct_messages_sent")
((eq type 'friends) ":friends")
((eq type 'home) (if shorten "~" ":home"))
((eq type 'mentions) ":mentions")
Expand Down Expand Up @@ -721,8 +721,8 @@ Return cons of the spec and the rest string."
((string-match "^:\\([a-z_-]+\\)" str)
(let ((type (match-string 1 str))
(following (substring str (match-end 0)))
(alist '(("direct-messages" . direct-messages)
("direct-messages-sent" . direct-messages-sent)
(alist '(("direct_messages" . direct_messages)
("direct_messages_sent" . direct_messages_sent)
("friends" . friends)
("home" . home)
("mentions" . mentions)
Expand Down Expand Up @@ -830,7 +830,7 @@ Return nil if SPEC-STR is invalid as a timeline spec."
`filter' and `merge'."
(let ((primary-spec-types
'(user list
direct-messages direct-messages-sent
direct_messages direct_messages_sent
friends home mentions public replies
search
retweeted_by_me retweeted_to_me retweets_of_me))
Expand Down Expand Up @@ -858,8 +858,8 @@ Return nil if SPEC-STR is invalid as a timeline spec."
(list-name (cadr value)))
`("api.twitter.com"
,(concat "1/" username "/lists/" list-name "/statuses"))))
((or (eq type 'direct-messages)
(eq type 'direct-messages-sent))
((or (eq type 'direct_messages)
(eq type 'direct_messages_sent))
(error "%s has not been supported yet" type))
((eq type 'friends)
'("twitter.com" "statuses/friends_timeline"))
Expand Down

0 comments on commit 3f0c2b6

Please sign in to comment.