Revision 1004, 3.6 KB checked in by iwaim, 14 years ago (diff) |
---|
diff -uNr navi2ch.orig/navi2ch-machibbs.el navi2ch/navi2ch-machibbs.el
old | new | |
---|---|---|
1 | 1 | ;;; navi2ch-machibbs.el --- View machiBBS module for Navi2ch. -*- coding: iso-2022-7bit; -*- |
2 | 2 | |
3 | ;; Copyright (C) 2002, 2003, 2004 |
|
3 | ;; Copyright (C) 2002, 2003, 2004, 2009 by Navi2ch Project | |
4 | 4 | |
5 | 5 | ;; Author: |
6 | 6 | ;; Part5 $B%9%l$N(B 509 $B$NL>L5$7$5$s(B |
… | … | |
30 | 30 | ;;; Code: |
31 | 31 | (provide 'navi2ch-machibbs) |
32 | 32 | (defconst navi2ch-machibbs-ident |
33 | "$Id: navi2ch-machibbs.el,v 1.3 |
|
33 | "$Id: navi2ch-machibbs.el,v 1.32 2009/02/25 16:55:10 nawota Exp $") | |
34 | 34 | |
35 | 35 | (eval-when-compile (require 'cl)) |
36 | 36 | (require 'navi2ch-multibbs) |
… | … | |
76 | 76 | (navi2ch-multibbs-defcallback navi2ch-machibbs-subject-callback (machibbs) |
77 | 77 | "subject.txt $B$r<hF@$9$k$H$-(B navi2ch-net-update-file |
78 | 78 | $B$G;H$o$l$k%3!<%k%P%C%/4X?t(B" |
79 | (while (re-search-forward " |
|
80 | (replace-match "\\1 |
|
79 | (while (re-search-forward "[0-9]+<>\\([0-9]+\\)<>\\([^\n]+\n\\)" nil t) | |
80 | (replace-match "\\1.dat<>\\2"))) | |
81 | 81 | |
82 | 82 | (defun navi2ch-machibbs-article-update (board article start) |
83 | 83 | "BOARD ARTICLE $B$N5-;v$r99?7$9$k!#(B |
… | … | |
88 | 88 | (url (navi2ch-machibbs-article-to-url board article start nil start)) |
89 | 89 | (func (if start 'navi2ch-machibbs-article-callback-diff |
90 | 90 | 'navi2ch-machibbs-article-callback))) |
91 | (message "URL %s" url) | |
91 | 92 | (navi2ch-net-update-file url file time func nil start))) |
92 | 93 | |
93 | 94 | (defun navi2ch-machibbs-article-to-url (board article &optional start end nofirst) |
94 | 95 | "BOARD, ARTICLE $B$+$i(B url $B$KJQ49!#(B |
95 | START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" ; $B8z$+$J$+$C$?$i65$($F$/$@$5$$!#(B | |
96 | (let ((uri (cdr (assq 'uri board))) | |
97 | (artid (cdr (assq 'artid article)))) | |
98 | (string-match "\\(.*\\)\\/\\([^/]*\\)\\/" uri) ; \\/ --> / ? | |
99 | (concat | |
100 | (format "%s/bbs/read.pl?BBS=%s&KEY=%s" | |
101 | (match-string 1 uri) (match-string 2 uri) artid) | |
102 | (if (and (stringp start) | |
103 | (string-match "l\\([0-9]+\\)" start)) | |
104 | (format "&LAST=%s" (match-string 1 start)) | |
105 | (concat | |
106 | (and start (format "&START=%d" start)) | |
107 | (and end (format "&END=%d" end)))) | |
108 | (and nofirst | |
109 | (not (eq start 1)) | |
110 | "&NOFIRST=TRUE")))) | |
96 | START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" | |
97 | (let ((uri (navi2ch-board-get-uri board)) | |
98 | (start (if (numberp start) | |
99 | (number-to-string start) | |
100 | start)) | |
101 | (end (if (numberp end) | |
102 | (number-to-string end) | |
103 | end))) | |
104 | (if (string-match "\\(.+\\)/\\([^/]+\\)/$" uri) | |
105 | (format "%s/bbs/read.cgi/%s/%s/%s" | |
106 | (match-string 1 uri) (match-string 2 uri) | |
107 | (cdr (assq 'artid article)) | |
108 | (if (equal start end) | |
109 | (or start "") | |
110 | (concat start (and (or start end) "-") end)))))) | |
111 | 111 | |
112 | 112 | (defun navi2ch-machibbs-url-to-board (url) |
113 | 113 | "url $B$+$i(B BOARD $B$KJQ49!#(B" |
… | … | |
228 | 228 | (navi2ch-machibbs-article-callback t)) |
229 | 229 | |
230 | 230 | (defun navi2ch-machibbs-board-update (board) |
231 | (let ((url (navi2ch-board-get-url board)) | |
232 | (file (navi2ch-board-get-file-name board)) | |
233 | (time (cdr (assq 'time board))) | |
234 | (func (navi2ch-multibbs-subject-callback board))) | |
235 | (navi2ch-net-update-file url file time func))) | |
231 | (let ((uri (navi2ch-board-get-uri board))) | |
232 | (when (string-match "\\(.+\\)/\\([^/]+\\)/$" uri) | |
233 | (let ((url (format "%s/bbs/offlaw.cgi/%s/" | |
234 | (match-string 1 uri) | |
235 | (cdr (assq 'id board)))) | |
236 | (file (navi2ch-board-get-file-name board)) | |
237 | (time (cdr (assq 'time board))) | |
238 | (func (navi2ch-multibbs-subject-callback board))) | |
239 | (navi2ch-net-update-file url file time func))))) | |
236 | 240 | |
237 | 241 | ;;; navi2ch-machibbs.el ends here |