Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shinosaki/2ch-api-worker

2ch・5chのHTMLをdatに変換するCloudflare Workersアプリ/Convert 2ch (5ch) HTML to dat file on Cloudflare Workers.
https://github.com/shinosaki/2ch-api-worker

2ch 5ch cloudflare-workers proxy

Last synced: 3 months ago
JSON representation

2ch・5chのHTMLをdatに変換するCloudflare Workersアプリ/Convert 2ch (5ch) HTML to dat file on Cloudflare Workers.

Awesome Lists containing this project

README

        

# 2ch-api-worker

2ch-api-workerは2ちゃんねる(5ちゃんねる)のHTMLをdat形式に変換するCloudflare Workersアプリケーションです。

## ToDo
- [ ] linkedomからHTMLRewriterに移行

- [ ] サーバー移転の追従

## 使用方法
~~2chのURL(`https://greta.5ch.net/test/read.cgi/poverty/1653843928/`)のドメイン名部分(`greta.5ch.net`)をWorkerのドメイン名(``)に置き換えてアクセスするだけです。~~

下記のいずれか(read.cgi or dat)のURL形式に対応してます。

- `https:///test/read.cgi/<板/board>/<スレッドID/Thread ID>`
- `https:///<板/board>/dat/<スレッドID/Thread ID>.dat`

応答はShift-JISでエンコードされた[2chのdat](https://info.5ch.net/index.php/Monazilla/develop/dat)です。

URL末尾にクエリパラメータ`?charset=utf-8`を追加するとUTF-8になります。

### chMateの設定
[設定]→[実験的]→[検索に使うURL(追加用)]にコレを入力
```
過去ログ https:///test/read.cgi/{$bbs}/{$key}/
```

## 制限
- 書き込みには対応してないよ!
- 国外IPアドレスからのアクセスは[451 Unavailable For Legal Reasons](https://ja.wikipedia.org/wiki/HTTP_451)で弾かれるみたい

## Deploy

1. `git clone https://github.com/shinosaki/2ch-api-worker.git`
2. `cd 2ch-api-worker`
3. `npm install`
4. `npx wrangler login`
5. Edit `wrangler.toml`
6. `npm run deploy`

## License
[MIT](https://raw.githubusercontent.com/shinosaki/2ch-api-worker/main/LICENSE)