Changeset 62 for lang/elisp
- Timestamp:
- 08/03/08 11:42:05 (16 years ago)
- Location:
- lang/elisp/twittering-mode/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/twittering-mode/trunk/ChangeLog
r58 r62 1 2008-08-03 Tsuyoshi CHO <Tsuyoshi.CHO+develop@Gmail.com> 2 3 * twittering-mode.el (twittering-mode-version): Update to 0.6 4 * twittering-mode.el (twittering-friends-timeline-last-update): 新 5 規変数 6 (twittering-setftime, twittering-local-strftime) 7 (twittering-global-strftime): `twittering-local-strftime'を機能分 8 割 9 (twittering-http-get): オプション引数`parameters'を追加、他調整 10 (twittering-http-post): 同上の調整 11 (twittering-status-to-status-datum): last-updateを更新する処理を追 12 加 13 (twittering-friends-timeline, twittering-erase-old-statuses): 14 statusのupdate時にsinceをパラメータと指定する処理をサポート 15 1 16 2008-07-21 Tsuyoshi CHO <Tsuyoshi.CHO+develop@Gmail.com> 2 17 -
lang/elisp/twittering-mode/trunk/twittering-mode.el
r58 r62 46 46 (require 'parse-time) 47 47 48 (defconst twittering-mode-version "0. 5")48 (defconst twittering-mode-version "0.6") 49 49 50 50 (defun twittering-mode-version () … … 103 103 104 104 (defvar twittering-friends-timeline-data nil) 105 (defvar twittering-friends-timeline-last-update nil) 105 106 106 107 (defvar twittering-username-face 'twittering-username-face) … … 203 204 (t nil))) 204 205 206 (defun twittering-setftime (fmt string uni) 207 (format-time-string fmt ; like "%Y-%m-%d %H:%M:%S" 208 (apply 'encode-time (parse-time-string string)) 209 uni)) 205 210 (defun twittering-local-strftime (fmt string) 206 (format-time-string fmt ; like "%Y-%m-%d %H:%M:%S", shown in localtime 207 (apply 'encode-time (parse-time-string string)))) 211 (twittering-setftime fmt string nil)) 212 (defun twittering-global-strftime (fmt string) 213 (twittering-setftime fmt string t)) 214 208 215 209 216 (defvar twittering-debug-mode nil) … … 324 331 ;;; 325 332 326 (defun twittering-http-get (method-class method &optional sentinel)333 (defun twittering-http-get (method-class method &optional parameters sentinel) 327 334 (if (null sentinel) (setq sentinel 'twittering-http-get-default-sentinel)) 328 335 … … 354 361 request) 355 362 (setq request 356 (concat "GET http://twitter.com/" method-class "/" method ".xml HTTP/1.1" nl 363 (concat "GET http://twitter.com/" method-class "/" method 364 ".xml" 365 (when parameters 366 (concat "?" 367 (mapconcat 368 (lambda (param-pair) 369 (format "%s=%s" 370 (twittering-percent-encode (car param-pair)) 371 (twittering-percent-encode (cdr param-pair)))) 372 parameters 373 "&"))) 374 " HTTP/1.1" nl 357 375 "Host: twitter.com" nl 358 376 "User-Agent: " (twittering-user-agent) nl … … 581 599 request) 582 600 (setq request 583 (concat "POST http://twitter.com/" method-class "/" method ".xml?" 584 (if parameters 585 (mapconcat 586 (lambda (param-pair) 587 (format "%s=%s" 588 (twittering-percent-encode (car param-pair)) 589 (twittering-percent-encode (cdr param-pair)))) 590 parameters 591 "&")) 601 (concat "POST http://twitter.com/" method-class "/" method ".xml" 602 (when parameters 603 (concat "?" 604 (mapconcat 605 (lambda (param-pair) 606 (format "%s=%s" 607 (twittering-percent-encode (car param-pair)) 608 (twittering-percent-encode (cdr param-pair)))) 609 parameters 610 "&"))) 592 611 " HTTP/1.1" nl 593 612 "Host: twitter.com" nl … … 767 786 )) 768 787 788 ;; save last update time 789 (setq twittering-friends-timeline-last-update created-at) 790 769 791 (mapcar 770 792 (lambda (sym) … … 903 925 (if (not buf) 904 926 (twittering-stop) 905 (twittering-http-get "statuses" "friends_timeline") 906 )) 927 (if (not twittering-friends-timeline-last-update) 928 (twittering-http-get "statuses" "friends_timeline") 929 (let* ((system-time-locale "C") 930 (since 931 (twittering-global-strftime 932 "%a, %d %b %Y %H:%M:%S GMT" 933 twittering-friends-timeline-last-update))) 934 (twittering-http-get "statuses" "friends_timeline" 935 `(("since" . ,since))))))) 907 936 908 937 (if twittering-icon-mode … … 933 962 (interactive) 934 963 (setq twittering-friends-timeline-data nil) 935 (twittering-http-get "statuses" "friends_timeline")) 964 (if (not twittering-friends-timeline-last-update) 965 (twittering-http-get "statuses" "friends_timeline") 966 (let* ((system-time-locale "C") 967 (since 968 (twittering-global-strftime 969 "%a, %d %b %Y %H:%M:%S GMT" 970 twittering-friends-timeline-last-update))) 971 (twittering-http-get "statuses" "friends_timeline" 972 `(("since" . ,since)))))) 936 973 937 974 (defun twittering-click ()