class Bbs::Nichan::Board

2ちゃん板

Public Class Methods

from_url(url) click to toggle source
# File lib/bbiff/bbs_reader.rb, line 310
def from_url(url)
  uri = URI.parse(url)
  board_name = uri.path.split('/').reject(&:empty?).first
  return nil if board_name.nil?
  Board.send(:new, uri.hostname, uri.port, board_name)
end
new(hostname, port, name) click to toggle source
Calls superclass method Bbs::BoardBase::new
# File lib/bbiff/bbs_reader.rb, line 318
def initialize(hostname, port, name)
  super('CP932')
  @hostname, @port, @name = hostname, port, name

  @settings_url = URI.parse("http://#{hostname}:#{port}/#{name}/SETTING.TXT")
  @thread_list_url = URI.parse("http://#{hostname}:#{port}/#{name}/subject.txt")
end

Public Instance Methods

create_thread_from_line(line) click to toggle source
# File lib/bbiff/bbs_reader.rb, line 330
def create_thread_from_line(line)
  Thread.from_line(line, self)
end
dat_url(thread_num) click to toggle source
# File lib/bbiff/bbs_reader.rb, line 326
def dat_url(thread_num)
  "http://#{@hostname}:#{@port}/#{@name}/dat/#{thread_num}.dat"
end