From: bg66 Date: Thu, 8 Jan 2009 05:47:40 +0000 (+0000) Subject: * mixi.el (mixi-log-list-regexp): Follow the change of mixi. X-Git-Tag: mixi-el-2_2_0~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=0e5264e34e0628a61915657821e1666296ba5a23;p=elisp%2Fmixi.git * mixi.el (mixi-log-list-regexp): Follow the change of mixi. (mixi-log-list-page): Change to the constant from macro. (mixi-get-logs-internal): New function. (mixi-get-logs): Follow the change above. (mixi-log-self-list-page): New constant. (mixi-get-self-logs): New function. * sb-mixi.el (shimbun-mixi-default-group-alist): Add `logs.self'. --- diff --git a/ChangeLog b/ChangeLog index a4800d4..7ed111c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-01-08 OHASHI Akira + + * mixi.el (mixi-log-list-regexp): Follow the change of mixi. + (mixi-log-list-page): Change to the constant from macro. + (mixi-get-logs-internal): New function. + (mixi-get-logs): Follow the change above. + (mixi-log-self-list-page): New constant. + (mixi-get-self-logs): New function. + * sb-mixi.el (shimbun-mixi-default-group-alist): Add `logs.self'. + 2008-12-26 OHASHI Akira * mixi.el (mixi-replace-tab-and-space-to-nbsp): New user option. diff --git a/mixi-ja.texi b/mixi-ja.texi index c14f355..8368acd 100755 --- a/mixi-ja.texi +++ b/mixi-ja.texi @@ -14,7 +14,7 @@ @end direntry @copying -Copyright @copyright{} 2007, 2008 @w{OHASHI Akira}. +Copyright @copyright{} 2007, 2008, 2009 @w{OHASHI Akira}. @quotation Permission is granted to copy, distribute and/or modify this document @@ -815,6 +815,22 @@ friend $B%*%V%8%'%/%H$H?tCM$OF1;~$K;XDj$9$k$3$H$b$G$-$^$9!#(B @end cartouche @end defun +@defun mixi-get-self-logs &optional range +$B<+J,$NB-$"$H0lMw$rl9g$O:GBg$G$3$N?t$N<+J,$NB-$"$H$N$_$r ;; Keywords: hypermedia @@ -29,6 +29,7 @@ ;; * mixi-get-friends ;; * mixi-get-favorites ;; * mixi-get-logs +;; * mixi-get-self-logs ;; * mixi-get-recommended-friends (indies) ;; * mixi-get-diaries ;; * mixi-get-new-diaries @@ -138,7 +139,7 @@ (autoload 'w3m-retrieve "w3m") (autoload 'url-retrieve-synchronously "url")) -(defconst mixi-revision "$Revision: 1.202 $") +(defconst mixi-revision "$Revision: 1.203 $") (defgroup mixi nil "API library for accessing to mixi." @@ -1153,28 +1154,42 @@ Increase this value when unexpected error frequently occurs." (signal 'wrong-type-argument (list 'mixi-log-p log))) (aref (cdr log) 1)) -(defmacro mixi-log-list-page () - `(concat "/show_log.pl")) +(defconst mixi-log-list-page "/show_log.pl") (defconst mixi-log-list-regexp - "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) \\(.*?\\)") + "\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)\\(.*?\\)") -;;;###autoload -(defun mixi-get-logs (&optional range) - "Get logs." - (let ((items (mixi-get-matched-items (mixi-log-list-page) +(defun mixi-get-logs-internal (list-page &optional range) + (let ((items (mixi-get-matched-items list-page mixi-log-list-regexp - range))) + range)) + (year (nth 5 (decode-time (current-time)))) + (month (nth 4 (decode-time (current-time))))) (mapcar (lambda (item) - (mixi-make-log (mixi-make-friend (nth 5 item) (nth 6 item)) - (encode-time 0 - (string-to-number (nth 4 item)) - (string-to-number (nth 3 item)) - (string-to-number (nth 2 item)) - (string-to-number (nth 1 item)) - (string-to-number (nth 0 item))))) + (let ((month-of-item (string-to-number (nth 0 item)))) + (when (> month-of-item month) + (decf year)) + (setq month month-of-item) + (mixi-make-log (mixi-make-friend (nth 4 item) (nth 5 item)) + (encode-time 0 + (string-to-number (nth 3 item)) + (string-to-number (nth 2 item)) + (string-to-number (nth 1 item)) + month year)))) items))) +;;;###autoload +(defun mixi-get-logs (&optional range) + "Get logs." + (mixi-get-logs-internal mixi-log-list-page range)) + +(defconst mixi-log-self-list-page "/show_self_log.pl") + +;;;###autoload +(defun mixi-get-self-logs (&optional range) + "Get self logs." + (mixi-get-logs-internal mixi-log-self-list-page range)) + ;; Recommended friend. (defmacro mixi-recommended-friend-list-page () `(concat "http://indies.mixi.jp/recommend.pl")) diff --git a/sb-mixi.el b/sb-mixi.el index 43d0d72..2935f9c 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -1,6 +1,6 @@ ;;; sb-mixi.el --- shimbun backend for mixi -;; Copyright (C) 2006, 2007, 2008 OHASHI Akira +;; Copyright (C) 2006, 2007, 2008, 2009 OHASHI Akira ;; Author: OHASHI Akira ;; Keywords: news @@ -33,7 +33,7 @@ (require 'mixi-utils) (require 'shimbun) -(defconst shimbun-mixi-revision "$Revision: 1.65 $") +(defconst shimbun-mixi-revision "$Revision: 1.66 $") (eval-and-compile (luna-define-class shimbun-mixi (shimbun) (comment-cache release-cache)) @@ -53,6 +53,7 @@ (lambda (range) (mixi-get-messages 'noticebox range))) ("logs" . mixi-get-logs) + ("logs.self" . mixi-get-self-logs) ("my-diaries" . "/home.pl") ("mixi-el" . "/view_community.pl?id=1596390") ("news.newest.domestic" .