* .cvsignore: New file.
* AUTHORS: Ditto.
* COMPILE: Ditto.
* Makefile.am: Ditto.
* NEWS: Ditto.
* README: Ditto.
* acinclude.m4: Ditto.
* configure.ac: Ditto.
--- /dev/null
+install-sh
+missing
+Makefile.in
+Makefile
+aclocal.m4
+autom4te.cache
+configure
+config.log
+config.status
+config.cache
+COPYING
+INSTALL
--- /dev/null
+;;; -*- Emacs-Lisp -*-
+
+(defun mixi-compile-modules (modules)
+ (let ((load-path (cons nil load-path))
+ error-modules)
+ (while modules
+ (let ((source (expand-file-name (car modules))))
+ (if (file-newer-than-file-p source (concat source "c"))
+ (condition-case error
+ (byte-compile-file source)
+ (error
+ (setq error-modules (cons (car modules) error-modules))))))
+ (setq modules (cdr modules)))
+ (if error-modules
+ (princ (concat "\n\
+ WARNING: ---------------------------------------------------------
+ WARNING: Couldn't compile following modules:
+ WARNING:
+ WARNING: " (mapconcat #'identity error-modules ", ") "\n\
+ WARNING:
+ WARNING: You should probably stop here, try \"make distclean\" to clear
+ WARNING: the last build, and then reconfigure.
+ WARNING: ---------------------------------------------------------\n\n")))))
+
+(defun mixi-install-modules (modules dest just-print)
+ (unless (or just-print (file-exists-p dest))
+ (make-directory dest t))
+ (while modules
+ (let ((name (car modules)))
+ (princ (format "%s -> %s\n" name dest))
+ (unless just-print
+ (copy-file (expand-file-name name)
+ (expand-file-name name dest)
+ t t))
+ (princ (format "%sc -> %s\n" name dest))
+ (unless just-print
+ (if (file-exists-p (expand-file-name (concat name "c")))
+ (copy-file (expand-file-name (concat name "c"))
+ (expand-file-name (concat name "c") dest)
+ t t)
+ (princ (format "(%s was not successfully compiled, ignored)\n"
+ name)))))
+ (setq modules (cdr modules))))
+
+(defun mixi-install-just-print-p ()
+ (let ((flag (getenv "MAKEFLAGS"))
+ case-fold-search)
+ (if flag
+ (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag))))
+
+(defun mixi-compile ()
+ (mixi-compile-modules command-line-args-left))
+
+(defun mixi-install ()
+ (mixi-install-modules
+ (cdr command-line-args-left)
+ (expand-file-name "mixi" (car command-line-args-left))
+ (mixi-install-just-print-p)))
+
+(defun mixi-compile-package ()
+ (let ((modules (cdr command-line-args-left))
+ command-line-args-left)
+ (setq autoload-package-name "mixi")
+ (add-to-list 'command-line-args-left ".")
+ (batch-update-directory)
+ (add-to-list 'command-line-args-left ".")
+ (Custom-make-dependencies)
+ (mixi-compile-modules
+ (append modules
+ '("auto-autoloads.el" "custom-load.el")))))
+
+(defun mixi-install-package ()
+ (mixi-install-modules
+ (append (cdr command-line-args-left)
+ '("auto-autoloads.el" "custom-load.el"))
+ (expand-file-name "lisp/mixi" (car command-line-args-left))
+ (mixi-install-just-print-p)))
2007-02-16 OHASHI Akira <bg66@koka-in.org>
+ * mixi.el: Add autoload cookies.
+ * .cvsignore: New file.
+ * AUTHORS: Ditto.
+ * COMPILE: Ditto.
+ * Makefile.am: Ditto.
+ * NEWS: Ditto.
+ * README: Ditto.
+ * acinclude.m4: Ditto.
+ * configure.ac: Ditto.
+
+2007-02-16 OHASHI Akira <bg66@koka-in.org>
+
* mixi-gnus.el: Avoid errors and warnings when compiling.
* mixi-wl.el: Ditto.
--- /dev/null
+MODULES_MIXI = mixi.el
+MODULES_ALL = $(MODULES_MIXI) sb-mixi.el mixi-gnus.el mixi-wl.el
+EXTRA_DIST = COMPILE ChangeLog $(MODULES_ALL)
+CLEANFILES = auto-autoloads.el custom-load.el *.elc
+AUTOMAKE_OPTIONS = no-dependencies
+
+FLAGS ?= -batch -q -no-site-file
+
+if HAVE_SHIMBUN
+MODULES = $(MODULES_ALL)
+else
+MODULES = $(MODULES_MIXI)
+endif
+
+all: elc
+
+elc:
+ $(EMACS) $(FLAGS) -l COMPILE -f mixi-compile $(MODULES)
+
+install: elc
+ $(EMACS) $(FLAGS) -l COMPILE -f mixi-install $(lispdir) $(MODULES)
+
+package:
+ $(XEMACS) $(FLAGS) -l COMPILE -f mixi-compile-package $(MODULES)
+
+install-package: package
+ $(XEMACS) $(FLAGS) -l COMPILE -f mixi-install-package $(PACKAGEDIR) \
+ $(MODULES)
--- /dev/null
+AC_DEFUN([AC_CHECK_EMACS],
+ [dnl Check for Emacsen.
+
+ dnl Apparently, if you run a shell window in Emacs, it sets the EMACS
+ dnl environment variable to 't'. Lets undo the damage.
+ test "$EMACS" = t && EMACS=
+
+ dnl Ignore cache.
+ unset ac_cv_prog_EMACS; unset ac_cv_prog_XEMACS;
+
+ AC_ARG_WITH(emacs,
+ [ --with-emacs=EMACS compile with EMACS [EMACS=emacs, mule...]],
+ [if test "$withval" = yes -o -z "$withval"; then
+ AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)
+ else
+ AC_CHECK_PROG(EMACS, $withval, $withval, emacs)
+ fi])
+ AC_ARG_WITH(xemacs,
+ [ --with-xemacs=XEMACS compile with XEMACS [XEMACS=xemacs]],
+ [if test "$withval" = yes -o -z "$withval"; then
+ AC_CHECK_PROG(XEMACS, xemacs, xemacs, xemacs)
+ else
+ AC_CHECK_PROG(XEMACS, $withval, $withval, xemacs)
+ fi
+ EMACS=$XEMACS],
+ [XEMACS=xemacs
+ test -z "$EMACS" && AC_CHECK_PROGS(EMACS, emacs xemacs mule, emacs)])
+ AC_SUBST(EMACS)
+ AC_SUBST(XEMACS)])
+
+AC_DEFUN([AC_EMACS_LISP], [
+elisp="$2"
+if test -z "$3"; then
+ AC_MSG_CHECKING(for $1)
+fi
+AC_CACHE_VAL(EMACS_cv_SYS_$1,[
+ OUTPUT=./conftest-$$
+ echo ${EMACS}' -batch -eval '\''(let ((x '${elisp}')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1
+ eval ${EMACS}' -batch -eval '\''(let ((x '${elisp}')) (write-region (if (stringp x) (princ x) (prin1-to-string x)) nil "'${OUTPUT}'" nil 5))'\' >& AC_FD_CC 2>&1
+ if test -f ${OUTPUT}; then
+ retval=`cat ${OUTPUT}`
+ echo "=> ${retval}" >& AC_FD_CC 2>&1
+ rm -f ${OUTPUT}
+ EMACS_cv_SYS_$1=$retval
+ else
+ EMACS_cv_SYS_$1=
+ fi
+])
+$1=${EMACS_cv_SYS_$1}
+if test -z "$3"; then
+ AC_MSG_RESULT($$1)
+fi
+])
+
+AC_DEFUN([AC_CHECK_EMACS_FLAVOR],
+ [AC_MSG_CHECKING([what flavor does $EMACS have])
+
+ dnl Ignore cache.
+ unset EMACS_cv_SYS_flavor;
+
+ AC_EMACS_LISP(flavor,
+ (cond ((featurep (quote xemacs)) \"XEmacs\")\
+ ((boundp (quote MULE)) \"MULE\")\
+ (t \"FSF Emacs\")),
+ "noecho")
+ case $EMACS_cv_SYS_flavor in
+ XEmacs)
+ EMACS_FLAVOR=xemacs;;
+ MULE)
+ EMACS_FLAVOR=mule;;
+ *)
+ EMACS_FLAVOR=emacs;;
+ esac
+ AC_MSG_RESULT($EMACS_cv_SYS_flavor)])
+
+AC_DEFUN([AC_PATH_LISPDIR], [
+ AC_CHECK_EMACS_FLAVOR
+ if test "$prefix" = NONE; then
+ AC_MSG_CHECKING([prefix for your Emacs])
+ AC_EMACS_LISP(prefix,(expand-file-name \"..\" invocation-directory),"noecho")
+ prefix=${EMACS_cv_SYS_prefix}
+ AC_MSG_RESULT($prefix)
+ fi
+ AC_ARG_WITH(lispdir,
+ [ --with-lispdir=DIR Where to install lisp files
+ (for XEmacs package, use --with-packagedir instead)],
+ lispdir=${withval})
+ AC_MSG_CHECKING([where lisp files should go])
+ if test -z "$lispdir"; then
+ dnl Set default value
+ theprefix=$prefix
+ if test "$theprefix" = NONE; then
+ theprefix=$ac_default_prefix
+ fi
+ lispdir="\$(datadir)/${EMACS_FLAVOR}/site-lis"
+ for thedir in share lib; do
+ potential=
+ if test -d ${theprefix}/${thedir}/${EMACS_FLAVOR}/site-lisp; then
+ lispdir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-lisp"
+ break
+ fi
+ done
+ fi
+ if test ${EMACS_FLAVOR} = xemacs; then
+ AC_MSG_RESULT([$lispdir
+ (it will be ignored when \"make install-package[[-ja]]\" is done)])
+ else
+ AC_MSG_RESULT([$lispdir])
+ fi
+ AC_SUBST(lispdir)
+])
+
+dnl
+dnl Perform sanity checking and try to locate the Shimbun package
+dnl
+AC_DEFUN([AC_CHECK_SHIMBUN], [
+ AC_MSG_CHECKING(for shimbun)
+
+ dnl Ignore cache.
+ unset EMACS_cv_SYS_shimbun_dir;
+
+ AC_ARG_WITH(shimbun,[ --with-shimbun[[=ARG]] Use shimbun [[ARG=yes]]],
+ [if test "$withval" = yes -o -z "$withval"; then
+ HAVE_SHIMBUN=yes
+ else
+ HAVE_SHIMBUN=$withval
+ fi], HAVE_SHIMBUN=yes)
+ AC_SUBST(HAVE_SHIMBUN)
+
+ if test "${HAVE_SHIMBUN}" = yes; then
+ AC_EMACS_LISP(shimbun_dir,(file-name-directory (locate-library \"shimbun\")),"noecho")
+ SHIMBUN_DIR=$EMACS_cv_SYS_shimbun_dir
+ fi
+
+ if test "${HAVE_SHIMBUN}" != yes; then
+ AC_MSG_RESULT(no)
+ elif test -z "${SHIMBUN_DIR}"; then
+ HAVE_SHIMBUN=no
+ AC_MSG_RESULT(not found)
+ else
+ AC_MSG_RESULT(${HAVE_SHIMBUN})
+ fi
+])
+
+AC_DEFUN([AC_EXAMINE_PACKAGEDIR],
+ [dnl Examine PACKAGEDIR.
+ AC_EMACS_LISP(PACKAGEDIR,
+ (let (package-dir)\
+ (if (boundp (quote early-packages))\
+ (let ((dirs (delq nil (append (if early-package-load-path\
+ early-packages)\
+ (if late-package-load-path\
+ late-packages)\
+ (if last-package-load-path\
+ last-packages)))))\
+ (while (and dirs (not package-dir))\
+ (if (file-directory-p (car dirs))\
+ (setq package-dir (car dirs)\
+ dirs (cdr dirs))))))\
+ (or package-dir \"\")),
+ "noecho")])
+
+AC_DEFUN([AC_PATH_PACKAGEDIR],
+ [dnl Check for PACKAGEDIR.
+ if test ${EMACS_FLAVOR} = xemacs; then
+ AC_MSG_CHECKING([where the XEmacs package is])
+ AC_ARG_WITH(packagedir,
+ [ --with-packagedir=DIR package DIR for XEmacs],
+ [if test "$withval" != yes -a -n "$withval"; then
+ PACKAGEDIR=$withval
+ else
+ AC_EXAMINE_PACKAGEDIR
+ fi],
+ AC_EXAMINE_PACKAGEDIR)
+ if test -z "$PACKAGEDIR"; then
+ AC_MSG_RESULT(not found)
+ else
+ AC_MSG_RESULT($PACKAGEDIR)
+ fi
+ else
+ PACKAGEDIR=
+ fi
+ AC_SUBST(PACKAGEDIR)])
+
+AC_DEFUN([AC_ADD_LOAD_PATH],
+ [dnl Check for additional load path.
+ AC_ARG_WITH(addpath,
+ [ --with-addpath=PATH search Emacs-Lisp libraries with PATH
+ use colons to separate directory names],
+ [if test "$withval" != yes -a -n "$withval"; then
+ AC_MSG_CHECKING([where to find the additional elisp libraries])
+ ADDITIONAL_LOAD_PATH=$withval
+ AC_MSG_RESULT($ADDITIONAL_LOAD_PATH)
+ fi],
+ ADDITIONAL_LOAD_PATH=)
+ AC_SUBST(ADDITIONAL_LOAD_PATH)])
+
--- /dev/null
+AC_INIT
+AC_PREREQ(2.59)
+AC_CONFIG_SRCDIR([mixi.el])
+AM_INIT_AUTOMAKE(mixi, 1.0.0)
+
+AC_CHECK_EMACS
+AC_PATH_LISPDIR
+AC_PATH_PACKAGEDIR
+
+AC_CHECK_SHIMBUN
+
+AM_CONDITIONAL(HAVE_SHIMBUN, test "${HAVE_SHIMBUN}" = yes)
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
(defconst mixi-friend-list-nick-regexp
"<td valign=middle>\\(.+\\)¤µ¤ó([0-9]+)<br />")
+;;;###autoload
(defun mixi-get-friends (&rest friend-or-range)
"Get friends of FRIEND."
(when (> (length friend-or-range) 2)
"<td BGCOLOR=#FDF9F2><font COLOR=#996600>̾ Á°</font></td>
<td COLSPAN=2 BGCOLOR=#FFFFFF>\\(.+\\)</td></tr>")
+;;;###autoload
(defun mixi-get-favorites (&optional range)
"Get favorites."
(let ((ids (mixi-get-matched-items (mixi-favorite-list-page)
(defconst mixi-log-list-regexp
"\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) <a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a></li>")
+;;;###autoload
(defun mixi-get-logs (&optional range)
"Get logs."
(let ((items (mixi-get-matched-items (mixi-log-list-page)
<td ALIGN=center ROWSPAN=3 NOWRAP bgcolor=#F2DDB7><font COLOR=#996600>\\([0-9]+\\)·î\\([0-9]+\\)Æü<br>\\([0-9]+\\):\\([0-9]+\\)</font>\\(<br><input type=\"checkbox\" name=\"diary_id\" value=\"[0-9]+\">\\|\\)</td>
<td bgcolor=\"#FFF4E0\"> <a href=\"view_diary\\.pl\\?id=\\([0-9]+\\)&owner_id=[0-9]+\">\\(.*\\)</a></td>")
+;;;###autoload
(defun mixi-get-diaries (&rest friend-or-range)
"Get diaries of FRIEND."
(when (> (length friend-or-range) 2)
"<td WIDTH=180><img src=http://img\\.mixi\\.jp/img/pen\\.gif ALIGN=left WIDTH=14 HEIGHT=16>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</td>
<td WIDTH=450><a class=\"new_link\" href=view_diary\\.pl\\?id=\\([0-9]+\\)&owner_id=\\([0-9]+\\)>\\(.+\\)</a> (\\(.*\\)) ")
+;;;###autoload
(defun mixi-get-new-diaries (&optional range)
"Get new diaries."
(let ((items (mixi-get-matched-items (mixi-new-diary-list-page)
</table>
</td></tr></table>")
+;;;###autoload
(defun mixi-search-diaries (keyword &optional range)
(let ((items (mixi-get-matched-items (mixi-search-diary-list-page keyword)
mixi-search-diary-list-regexp
"<b>\\(ºîÀ®\\|½ñ¤¹þ¤ß\\)¤¬´°Î»¤·¤Þ¤·¤¿¡£È¿±Ç¤Ë»þ´Ö¤¬¤«¤«¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¾¯¡¹¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£</b>")
;; FIXME: Support photos.
+;;;###autoload
(defun mixi-post-diary (title content)
"Post a diary."
(unless (stringp title)
(defconst mixi-community-list-name-regexp
"<td valign=middle>\\(.+\\)([0-9]+)</td>")
+;;;###autoload
(defun mixi-get-communities (&rest friend-or-range)
"Get communities of FRIEND."
(when (> (length friend-or-range) 2)
<td COLSPAN=2 WIDTH=370 BGCOLOR=#FFFFFF>\\([^<]+\\)</td></tr>")
;; FIXME: Support category.
+;;;###autoload
(defun mixi-search-communities (keyword &optional range)
(let ((items (mixi-get-matched-items (mixi-search-community-list-page
keyword)
`(concat "/add_bbs.pl?id=" (mixi-community-id community)))
;; FIXME: Support photos.
+;;;###autoload
(defun mixi-post-topic (community title content)
"Post a topic to COMMUNITY."
(unless (mixi-community-p community)
(defconst mixi-bbs-list-regexp
"<a href=view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)")
+;;;###autoload
(defun mixi-get-bbses (community &optional range)
"Get bbese of COMMUNITY."
(unless (mixi-community-p community)
(defconst mixi-new-bbs-list-regexp
"<a href=\"view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)&comment_count=\\([0-9]+\\)&comm_id=\\([0-9]+\\)\" class=\"new_link\">")
+;;;###autoload
(defun mixi-get-new-bbses (&optional range)
"Get new topics."
(let ((items (mixi-get-matched-items (mixi-new-bbs-list-page)
"<a href=\"view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)&comm_id=\\([0-9]+\\)\"><img src=http://img\\.mixi\\.jp/img/shbtn\\.gif ALT=¾ÜºÙ¤ò¸«¤ë BORDER=0 WIDTH=104 HEIGHT=19></a>")
;; FIXME: Support community and category.
+;;;###autoload
(defun mixi-search-bbses (keyword &optional range)
(let ((items (mixi-get-matched-items (mixi-search-bbs-list-page keyword)
mixi-search-bbs-list-regexp
</td>
</tr>")
+;;;###autoload
(defun mixi-get-comments (parent &optional range)
"Get comments of PARENT."
(unless (mixi-parent-p parent)
(defconst mixi-new-comment-list-regexp
"<a href=\"view_diary\\.pl\\?id=\\([0-9]+\\)&owner_id=\\([0-9]+\\)&comment_count=\\([0-9]+\\)\" class=\"new_link\">")
+;;;###autoload
(defun mixi-get-new-comments (&optional range)
"Get new comments."
(let ((items (mixi-get-matched-items (mixi-new-comment-list-page)
- mixi-new-comment-list-regexp
- range)))
+ mixi-new-comment-list-regexp
+ range)))
(delq nil
- (mapcar (lambda (item)
- (let* ((diary (mixi-make-diary
- (mixi-make-friend (nth 1 item))
+ (mapcar (lambda (item)
+ (let* ((diary (mixi-make-diary
+ (mixi-make-friend (nth 1 item))
(nth 0 item)))
- (comment-count (mixi-diary-comment-count diary))
+ (comment-count (mixi-diary-comment-count diary))
(count (string-to-number (nth 2 item))))
- (when (or (null comment-count)
- (< comment-count count))
+ (when (or (null comment-count)
+ (< comment-count count))
(mixi-diary-set-comment-count diary count)
- diary)))
- items))))
+ diary)))
+ items))))
(defun mixi-post-diary-comment-page (diary)
(concat "/add_comment.pl?&diary_id=" (mixi-diary-id diary)))
"&comm_id=" (mixi-community-id (mixi-event-community event))))
;; FIXME: Support photos.
+;;;###autoload
(defun mixi-post-comment (parent content)
"Post a comment to PARENT."
(unless (mixi-object-p parent)
(defconst mixi-message-list-regexp
"<td><a HREF=\"view_message\\.pl\\?id=\\(.+\\)&box=\\(.+\\)\">")
+;;;###autoload
(defun mixi-get-messages (&rest box-or-range)
"Get messages of BOX."
(when (> (length box-or-range) 2)
(defconst mixi-post-message-succeed-regexp
"<b>Á÷¿®´°Î»</b>¤·¤Þ¤·¤¿¡£")
+;;;###autoload
(defun mixi-post-message (friend title content)
"Post a message to FRIEND."
(unless (mixi-friend-p friend)
</td>
</tr>")
+;;;###autoload
(defun mixi-get-introductions (&rest friend-or-range)
"Get introductions of FRIEND."
(when (> (length friend-or-range) 2)
<td WIDTH=\"1%\" nowrap CLASS=\"f08\"><A HREF=\"list_news_media\\.pl\\?id=[0-9]+\">\\(.+\\)</A></td>
<td WIDTH=\"1%\" nowrap CLASS=\"f08\">\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</td></tr>")
+;;;###autoload
(defun mixi-get-news (category sort &optional range)
"Get news of CATEGORY and SORT."
(unless (mixi-news-category-p category)