Changeset 59 for lang/elisp/wassr-mode

Show
Ignore:
Timestamp:
07/26/08 14:05:30 (16 years ago)
Author:
tsuyoshi
Message:

Fix status update.

Location:
lang/elisp/wassr-mode/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/wassr-mode/trunk/ChangeLog

    r57 r59  
     12008-07-26  Tsuyoshi CHO  <Tsuyoshi.CHO+develop@Gmail.com> 
     2 
     3        * wassr-mode.el: ステータスのアップデートできるようになった 
     4        (wassr-http-get, wassr-http-post): typeを追加 
     5        (wassr-update-status-if-not-blank, wassr-update-lambda) 
     6        (wassr-update-jojo, wassr-friends-timeline) 
     7        (wassr-erase-old-statuses): 上記typeに対応 
     8 
    192008-07-21  Tsuyoshi CHO  <Tsuyoshi.CHO+develop@Gmail.com> 
    210 
  • lang/elisp/wassr-mode/trunk/wassr-mode.el

    r57 r59  
    315315;;; 
    316316 
    317 (defun wassr-http-get (method-class method &optional sentinel) 
     317(defun wassr-http-get (method-class method type &optional sentinel) 
    318318  (if (null sentinel) (setq sentinel 'wassr-http-get-default-sentinel)) 
    319319 
     
    345345                 request) 
    346346             (setq request 
    347                    (concat "GET http://" wassr-api-server "/" method-class "/" method ".xml HTTP/1.1" nl 
     347                   (concat "GET http://" wassr-api-server "/" method-class "/" 
     348                           method "." type " HTTP/1.1" nl 
    348349                           "Host: " wassr-api-server  nl 
    349350                           "User-Agent: " (wassr-user-agent) nl 
     
    497498      (let ((formatted-status (apply 'concat (nreverse result)))) 
    498499        (add-text-properties 0 (length formatted-status) 
    499                              `(username ,(attr 'user-screen-name)) 
     500                             `(username ,(attr 'user-login-id)) 
    500501                             formatted-status) 
    501502        formatted-status) 
     
    503504 
    504505(defun wassr-http-post 
    505   (method-class method &optional parameters contents sentinel) 
     506  (method-class method type &optional parameters contents sentinel) 
    506507  "Send HTTP POST request to `wassr-api-server' 
    507508 
     
    537538             request) 
    538539         (setq  request 
    539                 (concat "POST http://" wassr-api-server  "/" method-class "/" method ".xml?" 
     540                (concat "POST http://" wassr-api-server  "/" method-class "/" 
     541                        method "." type "?" 
    540542                        (if parameters 
    541543                            (mapconcat 
     
    683685       0 (length user-login-id) 
    684686       `(mouse-face highlight 
    685                     uri ,(concat "http://wassr.jp/user/" user-screen-name) 
     687                    uri ,(concat "http://wassr.jp/user/" user-login-id) 
    686688                    face wassr-username-face) 
    687689       user-login-id) 
     
    692694       `(mouse-face highlight 
    693695                    face wassr-username-face 
    694                     uri ,(concat "http://wassr.jp/user/" user-screen-name) 
     696                    uri ,(concat "http://wassr.jp/user/" user-login-id) 
    695697                    face wassr-username-face) 
    696698       user-screen-name) 
     
    809811  (if (string-match "^\\s-*\\(?:@[-_a-z0-9]+\\)?\\s-*$" status) 
    810812      nil 
    811     (wassr-http-post "statuses" "update" 
     813    (wassr-http-post "statuses" "update" "json" 
    812814                          `(("status" . ,status) 
    813815                            ("source" . "ws-mode"))) 
     
    825827  (interactive) 
    826828  (wassr-http-post 
    827    "statuses" "update" 
     829   "statuses" "update" "json" 
    828830   `(("status" . "\xd34b\xd22b\xd26f\xd224\xd224\xd268\xd34b") 
    829831     ("source" . "ws-mode")))) 
     
    833835                    msg) 
    834836      (wassr-http-post 
    835        "statuses" "update" 
     837       "statuses" "update" "json" 
    836838       `(("status" . ,(concat 
    837839                       "@" usr " " 
     
    865867    (if (not buf) 
    866868        (wassr-stop) 
    867       (wassr-http-get "statuses" "friends_timeline") 
     869      (wassr-http-get "statuses" "friends_timeline" "xml") 
    868870      )) 
    869871 
     
    895897  (interactive) 
    896898  (setq wassr-friends-timeline-data nil) 
    897   (wassr-http-get "statuses" "friends_timeline")) 
     899  (wassr-http-get "statuses" "friends_timeline" "xml")) 
    898900 
    899901(defun wassr-click ()