+2007-10-16 OHASHI Akira <bg66@koka-in.org>
+
+ * 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 <bg66@koka-in.org>
* mixi.el (mixi-diary-comment-list-regexp): Follow the change of mixi.
;; * 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
(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."
diary)))
items))))
+(defmacro mixi-new-bbs-comment-list-page ()
+ `(concat "/new_bbs_comment.pl?page=%d"))
+
+(defconst mixi-new-bbs-comment-list-regexp
+ "<a href=\"?view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)&comment_count=\\([0-9]+\\)&comm_id=\\([0-9]+\\)\"?>")
+
+;;;###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)))
(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))
'(("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)
: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."