Module: Otokonoramen500yen

Defined in:
lib/otokonoramen500yen.rb

Defined Under Namespace

Classes: Response

Constant Summary collapse

VERSION =
'0.0.3'

Class Method Summary collapse

Class Method Details

.getObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/otokonoramen500yen.rb', line 13

def Otokonoramen500yen.get
  page = open(url).read.toutf8
  doc = Hpricot(page)
  body = doc.search('//div[@class="bn_content_text"]').inner_text
  date = doc.search('//div[@class="bn_head"]').inner_text
  date = Time.utc(date.scan(/(\d+)年/).first.first,
                 date.scan(/(\d+)月/).first.first,
                 date.scan(/(\d+)日/).first.first,
                 date.scan(/(\d+)時/).first.first,
                 date.scan(/(\d+)分/).first.first)
  Response.new(body,date,url)
end

.urlObject



9
10
11
# File 'lib/otokonoramen500yen.rb', line 9

def Otokonoramen500yen.url
  'http://bn.merumo.ne.jp/backno/latestView.do?magId=00589575'
end