[1004] | 1 | diff -uNr navi2ch.orig/navi2ch-machibbs.el navi2ch/navi2ch-machibbs.el |
---|
| 2 | --- navi2ch.orig/navi2ch-machibbs.el 2008-08-26 23:01:44.000000000 +0900 |
---|
| 3 | +++ navi2ch/navi2ch-machibbs.el 2009-12-20 17:43:40.000000000 +0900 |
---|
| 4 | @@ -1,6 +1,6 @@ |
---|
| 5 | ;;; navi2ch-machibbs.el --- View machiBBS module for Navi2ch. -*- coding: iso-2022-7bit; -*- |
---|
| 6 | |
---|
| 7 | -;; Copyright (C) 2002, 2003, 2004 by Navi2ch Project |
---|
| 8 | +;; Copyright (C) 2002, 2003, 2004, 2009 by Navi2ch Project |
---|
| 9 | |
---|
| 10 | ;; Author: |
---|
| 11 | ;; Part5 $B%9%l$N(B 509 $B$NL>L5$7$5$s(B |
---|
| 12 | @@ -30,7 +30,7 @@ |
---|
| 13 | ;;; Code: |
---|
| 14 | (provide 'navi2ch-machibbs) |
---|
| 15 | (defconst navi2ch-machibbs-ident |
---|
| 16 | - "$Id: navi2ch-machibbs.el,v 1.30 2008/08/26 14:01:44 nawota Exp $") |
---|
| 17 | + "$Id: navi2ch-machibbs.el,v 1.32 2009/02/25 16:55:10 nawota Exp $") |
---|
| 18 | |
---|
| 19 | (eval-when-compile (require 'cl)) |
---|
| 20 | (require 'navi2ch-multibbs) |
---|
| 21 | @@ -76,8 +76,8 @@ |
---|
| 22 | (navi2ch-multibbs-defcallback navi2ch-machibbs-subject-callback (machibbs) |
---|
| 23 | "subject.txt $B$r<hF@$9$k$H$-(B navi2ch-net-update-file |
---|
| 24 | $B$G;H$o$l$k%3!<%k%P%C%/4X?t(B" |
---|
| 25 | - (while (re-search-forward "\\([0-9]+\\.\\)cgi\\([^\n]+\n\\)" nil t) |
---|
| 26 | - (replace-match "\\1dat\\2"))) |
---|
| 27 | + (while (re-search-forward "[0-9]+<>\\([0-9]+\\)<>\\([^\n]+\n\\)" nil t) |
---|
| 28 | + (replace-match "\\1.dat<>\\2"))) |
---|
| 29 | |
---|
| 30 | (defun navi2ch-machibbs-article-update (board article start) |
---|
| 31 | "BOARD ARTICLE $B$N5-;v$r99?7$9$k!#(B |
---|
| 32 | @@ -88,26 +88,26 @@ |
---|
| 33 | (url (navi2ch-machibbs-article-to-url board article start nil start)) |
---|
| 34 | (func (if start 'navi2ch-machibbs-article-callback-diff |
---|
| 35 | 'navi2ch-machibbs-article-callback))) |
---|
| 36 | + (message "URL %s" url) |
---|
| 37 | (navi2ch-net-update-file url file time func nil start))) |
---|
| 38 | |
---|
| 39 | (defun navi2ch-machibbs-article-to-url (board article &optional start end nofirst) |
---|
| 40 | "BOARD, ARTICLE $B$+$i(B url $B$KJQ49!#(B |
---|
| 41 | -START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" ; $B8z$+$J$+$C$?$i65$($F$/$@$5$$!#(B |
---|
| 42 | - (let ((uri (cdr (assq 'uri board))) |
---|
| 43 | - (artid (cdr (assq 'artid article)))) |
---|
| 44 | - (string-match "\\(.*\\)\\/\\([^/]*\\)\\/" uri) ; \\/ --> / ? |
---|
| 45 | - (concat |
---|
| 46 | - (format "%s/bbs/read.pl?BBS=%s&KEY=%s" |
---|
| 47 | - (match-string 1 uri) (match-string 2 uri) artid) |
---|
| 48 | - (if (and (stringp start) |
---|
| 49 | - (string-match "l\\([0-9]+\\)" start)) |
---|
| 50 | - (format "&LAST=%s" (match-string 1 start)) |
---|
| 51 | - (concat |
---|
| 52 | - (and start (format "&START=%d" start)) |
---|
| 53 | - (and end (format "&END=%d" end)))) |
---|
| 54 | - (and nofirst |
---|
| 55 | - (not (eq start 1)) |
---|
| 56 | - "&NOFIRST=TRUE")))) |
---|
| 57 | +START, END, NOFIRST $B$GHO0O$r;XDj$9$k(B" |
---|
| 58 | + (let ((uri (navi2ch-board-get-uri board)) |
---|
| 59 | + (start (if (numberp start) |
---|
| 60 | + (number-to-string start) |
---|
| 61 | + start)) |
---|
| 62 | + (end (if (numberp end) |
---|
| 63 | + (number-to-string end) |
---|
| 64 | + end))) |
---|
| 65 | + (if (string-match "\\(.+\\)/\\([^/]+\\)/$" uri) |
---|
| 66 | + (format "%s/bbs/read.cgi/%s/%s/%s" |
---|
| 67 | + (match-string 1 uri) (match-string 2 uri) |
---|
| 68 | + (cdr (assq 'artid article)) |
---|
| 69 | + (if (equal start end) |
---|
| 70 | + (or start "") |
---|
| 71 | + (concat start (and (or start end) "-") end)))))) |
---|
| 72 | |
---|
| 73 | (defun navi2ch-machibbs-url-to-board (url) |
---|
| 74 | "url $B$+$i(B BOARD $B$KJQ49!#(B" |
---|
| 75 | @@ -228,10 +228,14 @@ |
---|
| 76 | (navi2ch-machibbs-article-callback t)) |
---|
| 77 | |
---|
| 78 | (defun navi2ch-machibbs-board-update (board) |
---|
| 79 | - (let ((url (navi2ch-board-get-url board)) |
---|
| 80 | - (file (navi2ch-board-get-file-name board)) |
---|
| 81 | - (time (cdr (assq 'time board))) |
---|
| 82 | - (func (navi2ch-multibbs-subject-callback board))) |
---|
| 83 | - (navi2ch-net-update-file url file time func))) |
---|
| 84 | + (let ((uri (navi2ch-board-get-uri board))) |
---|
| 85 | + (when (string-match "\\(.+\\)/\\([^/]+\\)/$" uri) |
---|
| 86 | + (let ((url (format "%s/bbs/offlaw.cgi/%s/" |
---|
| 87 | + (match-string 1 uri) |
---|
| 88 | + (cdr (assq 'id board)))) |
---|
| 89 | + (file (navi2ch-board-get-file-name board)) |
---|
| 90 | + (time (cdr (assq 'time board))) |
---|
| 91 | + (func (navi2ch-multibbs-subject-callback board))) |
---|
| 92 | + (navi2ch-net-update-file url file time func))))) |
---|
| 93 | |
---|
| 94 | ;;; navi2ch-machibbs.el ends here |
---|