otokonoramen500yen 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/README.rdoc +9 -7
- data/bin/otokonoramen500yen +1 -1
- data/lib/otokonoramen500yen.rb +10 -5
- metadata +5 -7
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -6,17 +6,19 @@
|
|
6
6
|
|
7
7
|
男のらーめん500円の営業状態を取得する
|
8
8
|
|
9
|
-
==
|
9
|
+
== INSTALL:
|
10
10
|
|
11
|
-
|
12
|
-
% o = Otokonoramen500yen.get
|
13
|
-
% puts o.date
|
14
|
-
% puts o.body
|
11
|
+
* gem install otokonoramen500yen
|
15
12
|
|
16
13
|
|
17
|
-
==
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
require 'otokonoramen500yen'
|
17
|
+
o = Otokonoramen500yen.get
|
18
|
+
puts o.date
|
19
|
+
puts o.body
|
20
|
+
puts o.url
|
18
21
|
|
19
|
-
* gem install otokonoramen500yen
|
20
22
|
|
21
23
|
== LICENSE:
|
22
24
|
|
data/bin/otokonoramen500yen
CHANGED
data/lib/otokonoramen500yen.rb
CHANGED
@@ -4,10 +4,14 @@ require 'open-uri'
|
|
4
4
|
require 'kconv'
|
5
5
|
|
6
6
|
module Otokonoramen500yen
|
7
|
-
VERSION = '0.0.
|
7
|
+
VERSION = '0.0.3'
|
8
|
+
|
9
|
+
def Otokonoramen500yen.url
|
10
|
+
'http://bn.merumo.ne.jp/backno/latestView.do?magId=00589575'
|
11
|
+
end
|
8
12
|
|
9
13
|
def Otokonoramen500yen.get
|
10
|
-
page = open(
|
14
|
+
page = open(url).read.toutf8
|
11
15
|
doc = Hpricot(page)
|
12
16
|
body = doc.search('//div[@class="bn_content_text"]').inner_text
|
13
17
|
date = doc.search('//div[@class="bn_head"]').inner_text
|
@@ -16,14 +20,15 @@ module Otokonoramen500yen
|
|
16
20
|
date.scan(/(\d+)日/).first.first,
|
17
21
|
date.scan(/(\d+)時/).first.first,
|
18
22
|
date.scan(/(\d+)分/).first.first)
|
19
|
-
Response.new(body,date)
|
23
|
+
Response.new(body,date,url)
|
20
24
|
end
|
21
25
|
|
22
26
|
class Otokonoramen500yen::Response
|
23
|
-
attr_reader :body, :date
|
24
|
-
def initialize(body,date)
|
27
|
+
attr_reader :body, :date, :url
|
28
|
+
def initialize(body,date,url)
|
25
29
|
@body = body
|
26
30
|
@date = date
|
31
|
+
@url = url
|
27
32
|
end
|
28
33
|
end
|
29
34
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: otokonoramen500yen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sho Hashimoto
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-04-27 00:00:00
|
19
|
-
default_executable:
|
18
|
+
date: 2011-04-27 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: hpricot
|
@@ -74,7 +73,6 @@ files:
|
|
74
73
|
- test/test_otokonoramen500yen.rb
|
75
74
|
- bin/otokonoramen500yen
|
76
75
|
- .gemtest
|
77
|
-
has_rdoc: true
|
78
76
|
homepage: http://github.com/shokai/ruby-otokonoramen500yen
|
79
77
|
licenses: []
|
80
78
|
|
@@ -105,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
103
|
requirements: []
|
106
104
|
|
107
105
|
rubyforge_project: otokonoramen500yen
|
108
|
-
rubygems_version: 1.
|
106
|
+
rubygems_version: 1.7.2
|
109
107
|
signing_key:
|
110
108
|
specification_version: 3
|
111
109
|
summary: !binary |
|