|
@@ -0,0 +1,94 @@
|
|
|
|
+diff -uNr navi2ch.orig/navi2ch-machibbs.el navi2ch/navi2ch-machibbs.el
|
|
|
|
+--- navi2ch.orig/navi2ch-machibbs.el 2008-08-26 23:01:44.000000000 +0900
|
|
|
|
|
|
|
|
+@@ -1,6 +1,6 @@
|
|
|
|
+ ;;; navi2ch-machibbs.el --- View machiBBS module for Navi2ch. -*- coding: iso-2022-7bit; -*-
|
|
|
|
+
|
|
|
|
+-;; Copyright (C) 2002, 2003, 2004 by Navi2ch Project
|
|
|
|
++;; Copyright (C) 2002, 2003, 2004, 2009 by Navi2ch Project
|
|
|
|
+
|
|
|
|
+ ;; Author:
|
|
|
|
+ ;; Part5 $B%9%l$N(B 509 $B$NL>L5$7$5$s(B
|
|
|
|
+@@ -30,7 +30,7 @@
|
|
|
|
+ ;;; Code:
|
|
|
|
+ (provide 'navi2ch-machibbs)
|
|
|
|
+ (defconst navi2ch-machibbs-ident
|
|
|
|
+- "$Id: navi2ch-machibbs.el,v 1.30 2008/08/26 14:01:44 nawota Exp $")
|
|
|
|
++ "$Id: navi2ch-machibbs.el,v 1.32 2009/02/25 16:55:10 nawota Exp $")
|
|
|
|
+
|
|
|
|
+ (eval-when-compile (require 'cl))
|
|
|
|
+ (require 'navi2ch-multibbs)
|
|
|
|
+@@ -76,8 +76,8 @@
|
|
|
|
+ (navi2ch-multibbs-defcallback navi2ch-machibbs-subject-callback (machibbs)
|
|
|
|
+ "subject.txt $B$r<hF@$9$k$H$-(B navi2ch-net-update-file
|
|
|
|
+ $B$G;H$o$l$k%3!<%k%P%C%/4X?t(B"
|
|
|
|
+- (while (re-search-forward "\\([0-9]+\\.\\)cgi\\([^\n]+\n\\)" nil t)
|
|
|
|
+- (replace-match "\\1dat\\2")))
|
|
|
|
++ (while (re-search-forward "[0-9]+<>\\([0-9]+\\)<>\\([^\n]+\n\\)" nil t)
|
|
|
|
++ (replace-match "\\1.dat<>\\2")))
|
|
|
|
+
|
|
|
|
+ (defun navi2ch-machibbs-article-update (board article start)
|
|
|
|
+ "BOARD ARTICLE $B$N5-;v$r99?7$9$k!#(B
|
|
|
|
+@@ -88,26 +88,26 @@
|
|
|
|
+ (url (navi2ch-machibbs-article-to-url board article start nil start))
|
|
|
|
+ (func (if start 'navi2ch-machibbs-article-callback-diff
|
|
|
|
+ 'navi2ch-machibbs-article-callback)))
|
|
|
|
++ (message "URL %s" url)
|
|
|
|
+ (navi2ch-net-update-file url file time func nil start)))
|
|
|
|
+
|
|
|
|
+ (defun navi2ch-machibbs-article-to-url (board article &optional start end nofirst)
|
|
|
|
+ "BOARD, ARTICLE $B$+$i(B url $B$KJQ49!#(B
|
|
|
|
+-START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" ; $B8z$+$J$+$C$?$i65$($F$/$@$5$$!#(B
|
|
|
|
+- (let ((uri (cdr (assq 'uri board)))
|
|
|
|
+- (artid (cdr (assq 'artid article))))
|
|
|
|
+- (string-match "\\(.*\\)\\/\\([^/]*\\)\\/" uri) ; \\/ --> / ?
|
|
|
|
+- (concat
|
|
|
|
+- (format "%s/bbs/read.pl?BBS=%s&KEY=%s"
|
|
|
|
+- (match-string 1 uri) (match-string 2 uri) artid)
|
|
|
|
+- (if (and (stringp start)
|
|
|
|
+- (string-match "l\\([0-9]+\\)" start))
|
|
|
|
+- (format "&LAST=%s" (match-string 1 start))
|
|
|
|
+- (concat
|
|
|
|
+- (and start (format "&START=%d" start))
|
|
|
|
+- (and end (format "&END=%d" end))))
|
|
|
|
+- (and nofirst
|
|
|
|
+- (not (eq start 1))
|
|
|
|
+- "&NOFIRST=TRUE"))))
|
|
|
|
++START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B"
|
|
|
|
++ (let ((uri (navi2ch-board-get-uri board))
|
|
|
|
++ (start (if (numberp start)
|
|
|
|
++ (number-to-string start)
|
|
|
|
++ start))
|
|
|
|
++ (end (if (numberp end)
|
|
|
|
++ (number-to-string end)
|
|
|
|
++ end)))
|
|
|
|
++ (if (string-match "\\(.+\\)/\\([^/]+\\)/$" uri)
|
|
|
|
++ (format "%s/bbs/read.cgi/%s/%s/%s"
|
|
|
|
++ (match-string 1 uri) (match-string 2 uri)
|
|
|
|
++ (cdr (assq 'artid article))
|
|
|
|
++ (if (equal start end)
|
|
|
|
++ (or start "")
|
|
|
|
++ (concat start (and (or start end) "-") end))))))
|
|
|
|
+
|
|
|
|
+ (defun navi2ch-machibbs-url-to-board (url)
|
|
|
|
+ "url $B$+$i(B BOARD $B$KJQ49!#(B"
|
|
|
|
+@@ -228,10 +228,14 @@
|
|
|
|
+ (navi2ch-machibbs-article-callback t))
|
|
|
|
+
|
|
|
|
+ (defun navi2ch-machibbs-board-update (board)
|
|
|
|
+- (let ((url (navi2ch-board-get-url board))
|
|
|
|
+- (file (navi2ch-board-get-file-name board))
|
|
|
|
+- (time (cdr (assq 'time board)))
|
|
|
|
+- (func (navi2ch-multibbs-subject-callback board)))
|
|
|
|
+- (navi2ch-net-update-file url file time func)))
|
|
|
|
++ (let ((uri (navi2ch-board-get-uri board)))
|
|
|
|
++ (when (string-match "\\(.+\\)/\\([^/]+\\)/$" uri)
|
|
|
|
++ (let ((url (format "%s/bbs/offlaw.cgi/%s/"
|
|
|
|
++ (match-string 1 uri)
|
|
|
|
++ (cdr (assq 'id board))))
|
|
|
|
++ (file (navi2ch-board-get-file-name board))
|
|
|
|
++ (time (cdr (assq 'time board)))
|
|
|
|
++ (func (navi2ch-multibbs-subject-callback board)))
|
|
|
|
++ (navi2ch-net-update-file url file time func)))))
|
|
|
|
+
|
|
|
|
+ ;;; navi2ch-machibbs.el ends here
|