2ch-nntpd - simple and optimistic implementation of 2ch-to-NNTP gateway

Copyright (c) 2002  Daiki Ueno <ueno@unixuser.org>
You can redistribute it and/or modify it under either the terms of the GPL.

2ch-nntpd とは

2ch-nntpd は、2ch BBS の掲示板から記事を 取り寄せ NNTP で閲覧可能にする、個人用の簡単なゲートウエイです。Gnus や Wanderlust のようなニュースリーダで 2ch の記事を読むことができます。

制限

これでは寂しいので、起動時に列挙させたいグループを ~/.2ch-nntpd/startup から読み込むようにしました。

このファイルの書式は、カテゴリ、板、スレ、の順に改行で区切って並べ、 それらを更に空行で区切ったものです。エンコーディングは Shift_JIS です。 添付の startup を ~/.2ch-nntpd/startup にコピーしてお使いください。

必要なもの

インストール

2ch-nntpd を実行パスの通ったディレクトリにコピーします。

掲示板一覧の情報は、春山さんの 2ch ブラウザ goRuaの board_info 形式を流用しています。添付の board_info を ~/.2ch-nntpd/board_info にコピーしてお使いください。

起動方法

tcpserver 127.0.0.1 10119 ./2ch-nntpd [オプション]

--dir, -d workdir

キャッシュや board_info を読み込むディレクトリを指定します。 デフォルトは (~/.2ch-nntpd)

--kakasi, -k

グループ名のエンコーディングに KAKASI を利用します。

--ignore-board-info, -i

board_info ファイルを読み込まずに、 <URL:http://www.2ch.net/bbstable.html> から取得した情報を利用します。

実行例

./2ch-nntpd --kakasi
>>200 aquair 2ch NNTP gateway (no posting).

list
>>215 list of newsgroups follows
>>.

group PCnado.UNIX.nonexist 
>>411 No such group

list
>>215 list of newsgroups follows
>>...
>>PCnado.UNIX.SUNnodecchiage? 1 10 n
>>PCnado.UNIX.konomondaigatokerukana?(fufu 1 40 n
>>PCnado.UNIX.naniga(kantachihatachiagatta)ttajaboke!!!! 1 39 n
>>...

group PCnado.UNIX.Wanderlust
>>211 535 1 535 PCnado.UNIX.Wanderlust

head 535
>>221 535 <unix.1004108579.535@pc.2ch.net> head
>>Date: Sun, 17 Feb 2002 07:40:00 +0900
>>Subject: 535
>>...
>>.

<URL:http://deisui.org/~ueno/gnus-2ch-utf8.png>

<URL:http://deisui.org/~ueno/sylpheed-2ch.png>

Gnus で使う場合の設定例

(setq gnus-secondary-select-methods
      '((nntp "2ch"
              (nntp-open-connection-function 2ch-nntpd-open-connection))))

(defun 2ch-nntpd-open-connection (buffer)
  (let (selective-display               ; Disable ^M to nl translation.
        (coding-system-for-write 'binary)
        (coding-system-for-read 'binary)
        (shell-file-name "/bin/sh")
        process-connection-type)
    (start-process-shell-command "nntpd" buffer "2ch-nntpd 2> /dev/null")))

情報源