Project

simple2ch

0.0
No commit activity in last 3 years
No release in over 3 years
2ch Japanese BBS simple reader.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Simple2ch

2ch Japanese BBS simple reader for Ruby.

Ruby用の2chの簡易リーダーです。

gem version リファレンス

更新内容

[v1.1.0]

  • 全面的にメソッド数を見直し、大幅なリファクタリング
    • v0.X 系とは互換性一部なし
  • クラス名変更: Res -> Response, Thre -> Thread

[v0.1.9]

  • 著者をプレインテキストで返すメソッドを追加

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'

Simple2ch:BBS

bbs = Simple2ch::BBS(:sc)
bbs.boards #=> [#<Simple2ch::Board>, ...]

Simple2ch::Board

news_boards = bbs.boards.find_all { |b| b.title.include?('ニュース') } #=> [#<Simple2ch::Board>...]
news_board = news_boards.first
news_board.title #=> "ニュース速報α"
news_board.threads #=> [#<Simple2ch::Thread>, ...]

Simple2ch::Thre

thread = news_board.threads.first
thread.resonses #=> [#<Simple2ch::Response>, ...]

URLを直接指定して取得

thread = Simple2ch::Thread.new('http://toro.open2ch.net/test/read.cgi/tech/1371956681/') #=> #<Simple2ch::Thre>
thread.title #=> "さぁRubyはじめるよ"

Simple2ch::Res

thread.responses #=> [#<Simple2ch::Response>, ...]
res = thread.responses[0] #=> #<Simple2ch::Response>
res.res_num #=> 1
res.contents #=> "Ruby覚えたいなぁ"
res.author #=> "s"
res.author_id #=> "R/Yck7smD"
res.date #=> 2013-06-23 12:04:41 +0900
res.mail #=> ""

Contributing

  1. Fork it ( https://github.com/dogwood008/simple2ch/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request