")"))))
(concat prefix subject suffix))))))
-(defun mixi-make-author (object)
+(defun mixi-make-author (object &optional add-comment-count)
(with-mixi-class object
- (if (eq class 'mixi-news)
- (mixi-news-media object)
- (let ((owner (if (eq class 'mixi-log)
- (mixi-log-friend object)
- (mixi-object-owner object))))
- (mixi-friend-nick owner)))))
+ (cond ((eq class 'mixi-news)
+ (mixi-news-media object))
+ ((and add-comment-count
+ (eq class 'mixi-comment)
+ (mixi-bbs-p (mixi-comment-parent object)))
+ (concat (mixi-comment-count object) " "
+ (mixi-friend-nick (mixi-comment-owner object))))
+ (t
+ (let ((owner (if (eq class 'mixi-log)
+ (mixi-log-friend object)
+ (mixi-object-owner object))))
+ (mixi-friend-nick owner))))))
(defun mixi-make-date (object)
(let* ((time (mixi-object-time object))
(autoload 'w3m-retrieve "w3m")
(autoload 'url-retrieve-synchronously "url"))
-(defconst mixi-revision "$Revision: 1.175 $")
+(defconst mixi-revision "$Revision: 1.176 $")
(defgroup mixi nil
"API library for accessing to mixi."
(funcall func parent page)))
;; Comment object.
-(defun mixi-make-comment (parent owner time content)
+(defun mixi-make-comment (parent owner time content &optional count)
"Return a comment object."
- (cons 'mixi-comment (vector parent owner time content)))
+ (cons 'mixi-comment (vector parent owner time content count)))
(defmacro mixi-comment-p (comment)
`(eq (mixi-object-class ,comment) 'mixi-comment))
(signal 'wrong-type-argument (list 'mixi-comment-p comment)))
(aref (cdr comment) 3))
+(defun mixi-comment-count (comment)
+ "Return the count of COMMENT."
+ (unless (mixi-comment-p comment)
+ (signal 'wrong-type-argument (list 'mixi-comment-p comment)))
+ (aref (cdr comment) 4))
+
(defun mixi-diary-comment-list-page (diary)
(concat "/view_diary.pl?full=1"
"&id=" (mixi-diary-id diary)
;; FIXME: Split regexp to time, owner(id and nick) and contents.
(defconst mixi-topic-comment-list-regexp
- "<span class=\"date\">\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</span></dt>
+ "<dt class=\"commentDate clearfix\"><span class=\"senderId\">\\(<input id=\"commentCheck01\" name=\"comment_id\" type=\"checkbox\" value=\"[0-9]+\" /><label for=\"commentCheck01\">\\|\\)\\([0-9]+\\)\\(<span class=\"deleteTextArea\"><a href=\"delete_bbs_comment\\.pl\\?id=[0-9]+&comm_id=[0-9]+&comment_id=[0-9]+\">¼«Ê¬¤Î¥³¥á¥ó¥È¤òºï½ü¤¹¤ë</a></span>\\|</label>\\|\\)</span>
+<span class=\"date\">\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</span></dt>
<dd>
<dl class=\"commentContent01\">
<dt><a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a></dt>
;; FIXME: Split regexp to time, owner(id and nick) and contents.
(defconst mixi-event-comment-list-regexp
- "<span class=\"date\">\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</span></dt>
+ "<dt class=\"commentDate clearfix\"><span class=\"senderId\">\\(<input id=\"commentCheck01\" name=\"comment_id\" type=\"checkbox\" value=\"[0-9]+\" /><label for=\"commentCheck01\">\\|\\)\\([0-9]+\\)\\(<span class=\"deleteTextArea\"><a href=\"delete_bbs_comment\\.pl\\?id=[0-9]+&comm_id=[0-9]+&comment_id=[0-9]+\">¼«Ê¬¤Î¥³¥á¥ó¥È¤òºï½ü¤¹¤ë</a></span>\\|</label>\\|\\)</span>
+<span class=\"date\">\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</span></dt>
<dd>
<dl class=\"commentContent01\">
<dt><a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a></dt>
(setq page nil))
(let ((items (mixi-get-matched-items page regexp range t)))
(mapcar (lambda (item)
- (let (owner-id owner-nick year month day hour minute content)
+ (let (owner-id owner-nick year month day hour minute content
+ count)
(if (eq (mixi-object-class parent) 'mixi-diary)
(progn
(setq owner-id (nth 1 item))
(setq hour (nth 7 item))
(setq minute (nth 8 item))
(setq content (nth 9 item)))
- (setq owner-id (nth 5 item))
- (setq owner-nick (nth 6 item))
- (setq year (nth 0 item))
- (setq month (nth 1 item))
- (setq day (nth 2 item))
- (setq hour (nth 3 item))
- (setq minute (nth 4 item))
- (setq content (nth 7 item)))
+ (setq owner-id (nth 8 item))
+ (setq owner-nick (nth 9 item))
+ (setq year (nth 3 item))
+ (setq month (nth 4 item))
+ (setq day (nth 5 item))
+ (setq hour (nth 6 item))
+ (setq minute (nth 7 item))
+ (setq content (nth 10 item))
+ (setq count (nth 1 item)))
(mixi-make-comment parent (mixi-make-friend owner-id
owner-nick)
(encode-time
(string-to-number day)
(string-to-number month)
(string-to-number year))
- content)))
+ content count)))
items))))
(defmacro mixi-new-comment-list-page ()
(require 'mixi-utils)
(require 'shimbun)
-(defconst shimbun-mixi-revision "$Revision: 1.59 $")
+(defconst shimbun-mixi-revision "$Revision: 1.60 $")
(eval-and-compile
(luna-define-class shimbun-mixi (shimbun) (comment-cache))
:group 'shimbun
:type 'boolean)
+(defcustom shimbun-mixi-add-comment-count-to-author t
+ "*If non-nil, add comment count to author."
+ :group 'shimbun
+ :type 'boolean)
+
;; FIXME: Don't use this user option.
(defcustom shimbun-mixi-page-articles 10
"*How many articles are there in one page."
"^new-"
(shimbun-current-group-internal
shimbun)))
- (mixi-make-author object)
+ (mixi-make-author object shimbun-mixi-add-comment-count-to-author)
(mixi-make-date object)
id
(if (eq class 'mixi-comment)