navi2ch-machibbs.el-r1.32.patch 3.6 KB

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