From 6f0347f9ea0b4a65df004ea48dd7c930a7e9e0cd Mon Sep 17 00:00:00 2001 From: bg66 Date: Tue, 16 Oct 2007 02:44:55 +0000 Subject: [PATCH] * mixi.el (mixi-new-bbs-comment-list-page): New macro. (mixi-new-bbs-comment-list-regexp): New constant. (mixi-get-new-bbs-comments): New function. * sb-mixi.el (shimbun-mixi-default-group-alist): Add it. (shimbun-mixi-group-alist): Remove unnecessary constants. --- ChangeLog | 8 ++++++++ mixi.el | 37 ++++++++++++++++++++++++++++++++++++- sb-mixi.el | 10 +++------- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f85825..29856f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-16 OHASHI Akira + + * mixi.el (mixi-new-bbs-comment-list-page): New macro. + (mixi-new-bbs-comment-list-regexp): New constant. + (mixi-get-new-bbs-comments): New function. + * sb-mixi.el (shimbun-mixi-default-group-alist): Add it. + (shimbun-mixi-group-alist): Remove unnecessary constants. + 2007-10-15 OHASHI Akira * mixi.el (mixi-diary-comment-list-regexp): Follow the change of mixi. diff --git a/mixi.el b/mixi.el index abdf94b..708e4cb 100644 --- a/mixi.el +++ b/mixi.el @@ -39,6 +39,7 @@ ;; * mixi-search-bbses ;; * mixi-get-comments ;; * mixi-get-new-comments +;; * mixi-get-new-bbs-comments ;; * mixi-get-messages ;; * mixi-get-introductions (broken) ;; * mixi-get-news @@ -135,7 +136,7 @@ (autoload 'w3m-retrieve "w3m") (autoload 'url-retrieve-synchronously "url")) -(defconst mixi-revision "$Revision: 1.172 $") +(defconst mixi-revision "$Revision: 1.173 $") (defgroup mixi nil "API library for accessing to mixi." @@ -2391,6 +2392,40 @@ Increase this value when unexpected error frequently occurs." diary))) items)))) +(defmacro mixi-new-bbs-comment-list-page () + `(concat "/new_bbs_comment.pl?page=%d")) + +(defconst mixi-new-bbs-comment-list-regexp + "") + +;;;###autoload +(defun mixi-get-new-bbs-comments (&optional range) + "Get new BBS comments." + (let ((items (mixi-get-matched-items (mixi-new-bbs-comment-list-page) + mixi-new-bbs-comment-list-regexp + range))) + (delq nil + (mapcar (lambda (item) + (let ((name (nth 0 item))) + (when (string= name "bbs") + (setq name "topic")) + (let ((make-func (intern (concat "mixi-make-" name))) + (comment-count-func + (intern (concat "mixi-" name "-comment-count"))) + (set-comment-count-func + (intern (concat "mixi-" name + "-set-comment-count")))) + (let* ((bbs (funcall make-func + (mixi-make-community (nth 3 item)) + (nth 1 item))) + (comment-count (funcall comment-count-func bbs)) + (count (string-to-number (nth 2 item)))) + (when (or (null comment-count) + (< comment-count count)) + (funcall set-comment-count-func bbs count) + bbs))))) + items)))) + (defun mixi-post-diary-comment-page (diary) (concat "/add_comment.pl?&diary_id=" (mixi-diary-id diary))) diff --git a/sb-mixi.el b/sb-mixi.el index 691b010..248929b 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -33,7 +33,7 @@ (require 'mixi-utils) (require 'shimbun) -(defconst shimbun-mixi-revision "$Revision: 1.57 $") +(defconst shimbun-mixi-revision "$Revision: 1.58 $") (eval-and-compile (luna-define-class shimbun-mixi (shimbun) (comment-cache)) @@ -43,6 +43,7 @@ '(("new-diaries" . mixi-get-new-diaries) ("new-comments" . mixi-get-new-comments) ("new-bbses" . mixi-get-new-bbses) + ("new-bbs-comments" . mixi-get-new-bbs-comments) ("messages" . mixi-get-messages) ("messages.sent" . (lambda (range) @@ -113,12 +114,7 @@ of mixi object." :type '(repeat (cons :fromat "%v" (string :tag "Group name") (radio (string :tag "URL") - (const :tag "New diaries" mixi-get-new-diaries) - (const :tag "New comments" mixi-get-new-comments) - (const :tag "New BBSes" mixi-get-new-bbses) - (const :tag "Messages" mixi-get-messages) - (const :tag "Logs" mixi-get-logs) - (function :tag "Other function"))))) + (function :tag "Function"))))) (defcustom shimbun-mixi-get-profile-with-diary t "*If non-nil, get his/her profile together with diaries." -- 1.7.10.4