Simple2ch
2ch Japanese BBS simple reader for Ruby.
Ruby用の2chの簡易リーダーです。
更新内容
[v0.1.5]
- デバッグ
- StandardErrorで例外を捕縛できない問題を修正
- DatParseException, NotA2chUrlException発生時に与えられたURLを表示するよう変更
- 機能追加
- おーぷん2ちゃんねる対応
[v0.1.4]
- デバッグ
- Thre#resesを実行した際に、IDを持たないレスがあれば、DatParseExceptionが起きる問題を修正
- エイリアス追加
- Thre#resをThre#resesのエイリアスに設定
Installation
Add this line to your application's Gemfile:
gem 'simple2ch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install simple2ch
Usage
初期化
require 'simple2ch'スレ取得
board = Simple2ch::Board.new('ニュー速VIP', 'http://viper.2ch.sc/news4vip/') board.thres #=>[#<Simple2ch::Thre>, ..., #<Simple2ch::Thre>]レス取得
hoge = SUM_OF_NUMBER1 thre = board.thres[hoge] #=> #<Simple2ch::Thre> thre.reses #=> [#<Simple2ch::Res>, ..., #<Simple2ch::Res>]書き込み内容取得
foo = SUM_OF_NUMBER2 res = thre.reses[foo] #=> #<Simple2ch::Res> res. #=> "以下、\(^o^)/でVIPがお送りします" res.contents #=> "hoge foo bar"
Contributing
- Fork it ( https://github.com/dogwood008/simple2ch/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request