;; mixi.el --- API libraries for accessing to mixi -*- coding: euc-jp -*-
-;; Copyright (C) 2005, 2006, 2007 OHASHI Akira
+;; Copyright (C) 2005, 2006, 2007, 2008 OHASHI Akira
;; Author: OHASHI Akira <bg66@koka-in.org>
;; Keywords: hypermedia
;; * mixi-get-friends
;; * mixi-get-favorites
;; * mixi-get-logs
+;; * mixi-get-recommended-friends (indies)
;; * mixi-get-diaries
;; * mixi-get-new-diaries
;; * mixi-search-diaries
;; * mixi-get-communities
;; * mixi-search-communities
+;; * mixi-get-recommended-communities (indies)
;; * mixi-get-bbses
;; * mixi-get-new-bbses
;; * mixi-search-bbses
(autoload 'w3m-retrieve "w3m")
(autoload 'url-retrieve-synchronously "url"))
-(defconst mixi-revision "$Revision: 1.176 $")
+(defconst mixi-revision "$Revision: 1.180 $")
(defgroup mixi nil
"API library for accessing to mixi."
(let ((page 1)
ids)
(catch 'end
- (while (or (null range) (< (length ids) range))
+ (while (and (or (null range) (< (length ids) range))
+ (or (= page 1) (and (stringp url) (string-match "%d" url))))
(with-mixi-retrieve (when url (format url page))
(let ((func (if reverse (progn
(goto-char (point-max))
(string-to-number (nth 0 item)))))
items)))
+;; Recommended friend.
+(defmacro mixi-recommended-friend-list-page ()
+ `(concat "http://indies.mixi.jp/recommend.pl"))
+
+(defconst mixi-recommended-friend-list-regexp
+ "<div class=\"iconListImage\"><a href=\"http://mixi\\.jp/show_friend\\.pl\\?id=\\([0-9]+\\)\" [^>]+>.+</a></div><span>\\(.+?\\)¤µ¤ó([0-9]+)</span>")
+
+;;;###autoload
+(defun mixi-get-recommended-friends (&optional range)
+ "Get recommended friends."
+ (let ((items (mixi-get-matched-items (mixi-recommended-friend-list-page)
+ mixi-recommended-friend-list-regexp
+ range)))
+ (mapcar (lambda (item)
+ (mixi-make-friend (nth 0 item) (nth 1 item)))
+ items)))
+
;; Diary object.
(defvar mixi-diary-cache (make-hash-table :test 'equal))
(defun mixi-make-diary (owner id &optional comment-count time title content)
(mixi-make-community (nth 0 item) (nth 1 item)))
items)))
+;; Recommended community.
+(defalias 'mixi-recommended-community-list-page
+ 'mixi-recommended-friend-list-page)
+
+(defconst mixi-recommended-community-list-regexp
+ "<div class=\"iconListImage\"><a href=\"http://mixi\\.jp/view_community\\.pl\\?id=\\([0-9]+\\)\" [^>]+>.+</a></div><span>\\(.+\\)([0-9]+)</span>")
+
+;;;###autoload
+(defun mixi-get-recommended-communities (&optional range)
+ "Get recommended communities."
+ (let ((items (mixi-get-matched-items (mixi-recommended-community-list-page)
+ mixi-recommended-community-list-regexp
+ range)))
+ (mapcar (lambda (item)
+ (mixi-make-community (nth 0 item) (nth 1 item)))
+ items)))
+
;; Topic object.
(defvar mixi-topic-cache (make-hash-table :test 'equal))
(defun mixi-make-topic (community id &optional comment-count time title owner
<span class=\"commentTitleDate\">\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</span>
</dt>
-
-
+
<dd>
\\(\\(.\\|\r?\n\\)*?\\)
(aset (cdr news) 6 content))
(defconst mixi-news-category-list '(domestic politics economy area abroad
- sports entertainment IT))
+ sports entertainment IT game-anime
+ column))
(defmacro mixi-news-category-p (category)
`(memq ,category mixi-news-category-list))