hotel_price 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a82631788a305757b3d0bffbe8298a441fba18511d678a80c20a2e045f9d408
4
- data.tar.gz: 8eadeb31ec3d5f4e2dc179f51e15cf3bd2955b5a5afdf8c427ab68f565880833
3
+ metadata.gz: fb5d2bbe6a153d6df58d558653addef88e4b54c83e5d9fc2784e8b9cb5e1a911
4
+ data.tar.gz: eb2f765f334d8c22827df5877356be34a74a114f91909439ce2efc43dc166c8a
5
5
  SHA512:
6
- metadata.gz: 1f1cf23d50086583c2096adefcd7a207cad65e775a5810c8e89ea0690a4a4995cff6dd8c0d2fe88dd59569f5768b1271c9cbe5ad09aa6348c6173dc51ee0b29a
7
- data.tar.gz: d254d83f23aabb34bc1164b8d263cecc13d2fc26d7b4ca4a63401399245304f05c786384ed18eda81e3bb84621386e930c4d59b4442aab7dd9068d9383057346
6
+ metadata.gz: 38428d2d3bcd9098d1d18050901bfe75ed5042be5b93a49d24bd45c0eb5bc7d9a270c0d0c3265c6ec8fdabb949a2ba5e0ee5269312b2dc141a69c826767befe7
7
+ data.tar.gz: 4958ec209501d14d06d58bf9ddf6c1df34bacf78a6f0cd3da7a1fbd17084cce69978854848e6d5d301f5645967665665c226d0aef300fac05414408b9de643ba
data/.gitignore CHANGED
@@ -8,6 +8,6 @@
8
8
  /tmp/
9
9
  /.envrc
10
10
  .idea
11
-
11
+ .DS_Store
12
12
  # rspec failure tracking
13
13
  .rspec_status
@@ -1,49 +1,33 @@
1
- # target_version:
2
- # rubocop v0.34.2
3
-
4
- # 自動生成されるものはチェック対象から除外する
5
1
  AllCops:
6
- Exclude:
7
- - "vendor/**/*" # rubocop config/default.yml
8
- - "db/schema.rb"
9
- - "db/migrate/*"
10
- DisplayCopNames: true
11
- TargetRubyVersion: 2.6.5
2
+ EnabledByDefault: true
3
+
4
+ Style/AndOr:
5
+ Enabled: false
12
6
 
13
- ##################### Style ##################################
14
7
  Style/ClassAndModuleChildren:
15
8
  Enabled: false
16
- # redirect_to xxx and return のイディオムを維持したい
17
- Style/AndOr:
18
- EnforcedStyle: conditionals
19
9
 
20
- # 日本語のコメントを許可する
21
10
  Style/AsciiComments:
22
11
  Enabled: false
23
12
 
24
- # do .. end から更にメソッドチェーンすると見づらいので
25
- # auto-correct せず、自分で修正する
26
- # spec 内は見た目が綺麗になるので許可
27
- Style/BlockDelimiters:
28
- AutoCorrect: false
29
- Exclude:
30
- - "spec/**/*"
13
+ Style/SymbolArray:
14
+ Enabled: false
15
+
16
+ Style/WordArray:
17
+ Enabled: false
18
+
19
+ Style/MixinGrouping:
20
+ Enabled: false
21
+
22
+ Style/RescueStandardError:
23
+ Enabled: false
24
+
25
+ Style/MethodCallWithArgsParentheses:
26
+ Enabled: false
27
+
28
+ Style/DocumentationMethod:
29
+ Enabled: false
31
30
 
32
- # option 等、明示的にハッシュにした方が分かりやすい場合もある
33
- Style/BracesAroundHashParameters:
34
- Enabled: false
35
-
36
- # Style/CollectionMethods 自体は無効になっているのだが、
37
- # https://github.com/bbatsov/rubocop/issues/1084
38
- # https://github.com/bbatsov/rubocop/issues/1334
39
- # Performance/Detect がこの設定値を見るので PreferredMethods だけ変更しておく。
40
- #
41
- # デフォルト値から変えたのは
42
- # find -> detect
43
- # ActiveRecord の find と間違えやすいため
44
- # reduce -> inject
45
- # detect, reject, select と並べたときに韻を踏んでいるため。
46
- # collect -> map を維持しているのは文字数が圧倒的に少ないため。
47
31
  Style/CollectionMethods:
48
32
  PreferredMethods:
49
33
  detect: "detect"
@@ -51,152 +35,104 @@ Style/CollectionMethods:
51
35
  inject: "inject"
52
36
  reduce: "inject"
53
37
 
54
- # ドキュメントの無い public class を許可する
55
38
  Style/Documentation:
56
39
  Enabled: false
57
40
 
58
- # !! のイディオムは積極的に使う
59
41
  Style/DoubleNegation:
60
42
  Enabled: false
61
43
 
62
- # MethodDefParentheses:
63
- # EnforcedStyle: require_no_parentheses
64
-
65
- # メソッドチェーンの改行は末尾に . を入れる
66
- # REPL に貼り付けた際の暴発を防ぐため
44
+ Lint/ConstantResolution:
45
+ Enabled: false
46
+
67
47
  Layout/DotPosition:
68
48
  EnforcedStyle: trailing
69
49
 
70
- Layout/LineLength:
71
- Enabled: false
72
50
 
73
51
  Layout/EmptyLineAfterGuardClause:
74
52
  Enabled: false
75
53
 
76
- # 明示的に else で nil を返すのは分かりやすいので許可する
77
54
  Style/EmptyElse:
78
55
  EnforcedStyle: empty
79
56
 
80
- # 桁揃えが綺麗にならないことが多いので migration は除外
81
57
  Layout/ExtraSpacing:
82
58
  Exclude:
83
59
  - "db/migrate/*.rb"
84
60
 
85
- # いずれかに揃えるのならば `sprintf` や `format` より String#% が好きです
86
61
  Style/FormatString:
87
62
  EnforcedStyle: percent
88
63
 
89
- # if 文の中に 3 行程度のブロックを書くぐらいは許容した方が現実的
64
+ Style/MissingElse:
65
+ Enabled: false
66
+
67
+ Style/StringHashKeys:
68
+ Exclude:
69
+ - "spec/queries/*.rb"
70
+ - "*.gemspec"
71
+
90
72
  Style/GuardClause:
91
73
  MinBodyLength: 5
92
74
 
93
- # rake タスクの順序の hash は rocket を許可する
94
75
  Style/HashSyntax:
95
76
  EnforcedStyle: ruby19
77
+ Exclude:
78
+ - "**/*.rake"
79
+ - "Rakefile"
96
80
 
97
-
98
- # 条件式の方を意識させたい場合には後置の if/unless を使わない方が分かりやすい
99
81
  Style/IfUnlessModifier:
100
82
  Enabled: false
101
83
 
102
- # private/protected は一段深くインデントする
103
84
  Style/PreferredHashMethods:
104
85
  EnforcedStyle: short
105
86
 
106
- # scope 等は複数行でも lambda ではなく ->{} で揃えた方が見た目が綺麗
107
87
  Style/Lambda:
108
88
  Enabled: false
109
89
 
110
- # 1_000_000 と区切り文字が 2 個以上必要になる場合のみ _ 区切りを必須にする
111
90
  Style/NumericLiterals:
112
91
  MinDigits: 7
113
92
 
114
- # 正規表現にマッチさせた時の特殊変数の置き換えは Regex.last_match ではなく
115
- # 名前付きキャプチャを使って参照したいので auto-correct しない
116
93
  Style/PerlBackrefs:
117
94
  AutoCorrect: false
118
95
 
119
- # has_ から始まるメソッドは許可する
120
- Naming/PredicateName:
121
- ForbiddenPrefixes:
122
- - "is_"
123
- - "have_"
124
- NamePrefix:
125
- - "is_"
126
- - "have_"
127
-
128
- # 特に model 内において、ローカル変数とメソッド呼び出しの区別をつけた方が分かりやすい場合が多い
129
96
  Style/RedundantSelf:
130
97
  Enabled: false
131
98
 
132
99
  Style/FrozenStringLiteralComment:
133
100
  Enabled: false
134
101
 
135
- # 受け取り側で multiple assignment しろというのを明示
136
102
  Style/RedundantReturn:
137
103
  AllowMultipleReturnValues: true
138
104
 
139
- # spec 内は見た目が綺麗になるので許可
140
105
  Style/Semicolon:
141
106
  Exclude:
142
107
  - "spec/**/*"
143
108
 
144
- # fail と使い分ける必要ナシ
145
109
  Style/SignalException:
146
110
  EnforcedStyle: only_raise
147
111
 
148
112
  Style/MethodDefParentheses:
149
113
  Enabled: false
150
114
 
151
- # `||` も align に使うことがあるので追加する
152
- # Style/SpaceAroundOperators:
153
- # MultiSpaceAllowedForOperators:
154
- # - "="
155
- # - "=>"
156
- # - "||"
157
-
158
- # * 式展開したい場合に書き換えるのが面倒
159
- # * 文章ではダブルクォートよりもシングルクォートの方が頻出する
160
- # ことから EnforcedStyle: double_quotes 推奨
161
115
  Style/StringLiterals:
162
116
  EnforcedStyle: double_quotes
163
117
 
164
- # auto-correct 時に Style/StringLiterals とカニバって無限ループになる (v0.28.0)
165
118
  Style/StringLiteralsInInterpolation:
166
119
  Enabled: false
167
120
 
168
- # いくらなんでも inject { |a, e| } は短すぎるので分かりやすい名前をつけたい
169
121
  Style/SingleLineBlockParams:
170
122
  Enabled: false
171
123
 
172
- # * migrate
173
- # * jbuilder
174
- # * model の association
175
- # * controller の callback
176
- # 辺りの桁揃えで引っかかるので全体的にチェックしない
177
- # Style/SingleSpaceBeforeFirstArg:
178
- # Enabled: false
179
-
180
-
181
- ##################### Lint ##################################
182
-
183
- # * 同名のメソッドがある場合にローカル変数に `_` を付ける
184
- # * 一時変数として `_` を付ける
185
- # というテクニックは頻出する
186
124
  Lint/UnderscorePrefixedVariableName:
187
125
  Enabled: false
188
126
 
189
- # 子クラスで実装させるつもりのメソッドで引っかかるので
190
127
  Lint/UnusedMethodArgument:
191
128
  Enabled: false
192
129
 
193
- ##################### Metrics ##################################
194
130
 
195
131
  Metrics/AbcSize:
196
132
  Enabled: false
197
133
 
198
134
  Metrics/CyclomaticComplexity:
199
- Enabled: false
135
+ Max: 10
200
136
 
201
137
  Metrics/PerceivedComplexity:
202
138
  Enabled: false
@@ -204,6 +140,10 @@ Metrics/PerceivedComplexity:
204
140
  Metrics/BlockLength:
205
141
  Enabled: false
206
142
 
143
+ Layout/LineLength:
144
+ Enabled: false
145
+
146
+
207
147
  Metrics/MethodLength:
208
148
  Enabled: false
209
149
 
@@ -216,14 +156,35 @@ Naming/HeredocDelimiterNaming:
216
156
  Naming/AccessorMethodName:
217
157
  Enabled: false
218
158
 
219
- Style/MutableConstant:
159
+ Metrics/ModuleLength:
220
160
  Enabled: false
221
161
 
222
- Lint/NonDeterministicRequireOrder:
162
+ Lint/UnusedBlockArgument:
223
163
  Enabled: false
224
164
 
225
- Style/RescueModifier:
165
+ Lint/RescueException:
226
166
  Enabled: false
227
167
 
228
- Style/RegexpLiteral:
168
+ Naming/RescuedExceptionsVariableName:
169
+ Enabled: false
170
+
171
+ Bundler/GemComment:
172
+ Enabled: false
173
+
174
+ Style/SafeNavigation:
175
+ Enabled: false
176
+
177
+ Lint/NumberConversion:
178
+ Enabled: false
179
+ Style/ConstantVisibility:
180
+ Enabled: false
181
+ Style/MutableConstant:
182
+ Enabled: false
183
+ Style/Copyright:
184
+ Enabled: false
185
+ Style/MultilineTernaryOperator:
186
+ Enabled: false
187
+ Layout/MultilineAssignmentLayout:
188
+ Enabled: false
189
+ Style/Send:
229
190
  Enabled: false
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hotel_price (0.5.3)
5
- activesupport (~> 6.0.2.1)
6
- json (~> 2.3.0)
4
+ hotel_price (0.5.9)
5
+ activesupport (~> 6.0.2.2)
6
+ json (~> 2.3.1)
7
7
  nokogiri (~> 1.10.9)
8
8
  selenium-webdriver (~> 3.141)
9
9
 
@@ -18,28 +18,28 @@ GEM
18
18
  zeitwerk (~> 2.2)
19
19
  childprocess (3.0.0)
20
20
  concurrent-ruby (1.1.6)
21
- diff-lcs (1.3)
22
- i18n (1.8.2)
21
+ diff-lcs (1.4.4)
22
+ i18n (1.8.5)
23
23
  concurrent-ruby (~> 1.0)
24
- json (2.3.0)
24
+ json (2.3.1)
25
25
  mini_portile2 (2.4.0)
26
- minitest (5.14.0)
27
- nokogiri (1.10.9)
26
+ minitest (5.14.1)
27
+ nokogiri (1.10.10)
28
28
  mini_portile2 (~> 2.4.0)
29
29
  rake (13.0.1)
30
30
  rspec (3.9.0)
31
31
  rspec-core (~> 3.9.0)
32
32
  rspec-expectations (~> 3.9.0)
33
33
  rspec-mocks (~> 3.9.0)
34
- rspec-core (3.9.0)
35
- rspec-support (~> 3.9.0)
36
- rspec-expectations (3.9.0)
34
+ rspec-core (3.9.2)
35
+ rspec-support (~> 3.9.3)
36
+ rspec-expectations (3.9.2)
37
37
  diff-lcs (>= 1.2.0, < 2.0)
38
38
  rspec-support (~> 3.9.0)
39
- rspec-mocks (3.9.0)
39
+ rspec-mocks (3.9.1)
40
40
  diff-lcs (>= 1.2.0, < 2.0)
41
41
  rspec-support (~> 3.9.0)
42
- rspec-support (3.9.0)
42
+ rspec-support (3.9.3)
43
43
  rubyzip (2.3.0)
44
44
  selenium-webdriver (3.142.7)
45
45
  childprocess (>= 0.5, < 4.0)
@@ -47,7 +47,7 @@ GEM
47
47
  thread_safe (0.3.6)
48
48
  tzinfo (1.2.7)
49
49
  thread_safe (~> 0.1)
50
- zeitwerk (2.3.0)
50
+ zeitwerk (2.4.0)
51
51
 
52
52
  PLATFORMS
53
53
  ruby
@@ -56,7 +56,7 @@ DEPENDENCIES
56
56
  bundler (~> 2.0)
57
57
  hotel_price!
58
58
  rake (>= 12.3.3)
59
- rspec (~> 3.0)
59
+ rspec (~> 3.9.0)
60
60
 
61
61
  BUNDLED WITH
62
62
  2.1.4
data/README.md CHANGED
@@ -31,7 +31,7 @@ Rakuten Travel API Reference : https://webservice.rakuten.co.jp/api/simplehotels
31
31
 
32
32
 
33
33
  ```ruby
34
- hotel = HotelPrice::Rakuten::RakutenScraper.new(
34
+ hotel = HotelPrice::Rakuten::RakutenAPI.new(
35
35
  rakuten_hotel_id: "128552",
36
36
  rakuten_api_key: "api_key"
37
37
  )
@@ -8,20 +8,21 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ["Fumitake Kawasaki", "James Neve"]
9
9
  spec.email = ["fumitake.kawasaki@el-soul.com", "jamesoneve@gmail.com"]
10
10
 
11
- spec.summary = %q{Scraping Library to get world hotel price}
12
- spec.description = %q{Empower World Travel Information Technology }
13
- spec.homepage = "https://github.com/el-fudo/hotel_price"
11
+ spec.summary = "Scraping Library to get world hotel price"
12
+ spec.description = "Empower World Travel Information Technology "
13
+ spec.homepage = "https://github.com/elsoul/hotel_price"
14
14
  spec.license = "MIT"
15
- spec.metadata = { "source_code_uri" =>"https://github.com/el-fudo/hotel_price" }
15
+ spec.metadata = { "source_code_uri" => "https://github.com/elsoul/hotel_price" }
16
+ spec.required_ruby_version = ">= 2.7.0"
16
17
  # spec.metadata["allowed_push_host"] = "https://hotel.el-soul.com"
17
18
 
18
19
  spec.metadata["homepage_uri"] = spec.homepage
19
- spec.metadata["source_code_uri"] = "https://github.com/el-fudo/hotel_price"
20
- spec.metadata["changelog_uri"] = "https://github.com/el-fudo/hotel_price"
20
+ spec.metadata["source_code_uri"] = "https://github.com/elsoul/hotel_price"
21
+ spec.metadata["changelog_uri"] = "https://github.com/elsoul/hotel_price"
21
22
 
22
23
  # Specify which files should be added to the gem when it is released.
23
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
26
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
27
  end
27
28
  spec.bindir = "exe"
@@ -30,9 +31,9 @@ Gem::Specification.new do |spec|
30
31
 
31
32
  spec.add_development_dependency "bundler", "~> 2.0"
32
33
  spec.add_development_dependency "rake", ">= 12.3.3"
33
- spec.add_development_dependency "rspec", "~> 3.0"
34
- spec.add_runtime_dependency "activesupport", "~> 6.0.2.1"
34
+ spec.add_development_dependency "rspec", "~> 3.9.0"
35
+ spec.add_runtime_dependency "activesupport", "~> 6.0.2.2"
36
+ spec.add_runtime_dependency "json", "~> 2.3.1"
35
37
  spec.add_runtime_dependency "nokogiri", "~> 1.10.9"
36
38
  spec.add_runtime_dependency "selenium-webdriver", "~> 3.141"
37
- spec.add_runtime_dependency "json", "~> 2.3.0"
38
39
  end
@@ -23,7 +23,7 @@ module HotelPrice
23
23
  def self.rakuten_travel
24
24
  driver = self.get_selenium_driver
25
25
  rakuten_travel_hotel_id = 128552
26
- driver.get("https://travel.rakuten.co.jp/HOTEL/#{rakuten_travel_hotel_id.to_s}/review.html")
26
+ driver.get("https://travel.rakuten.co.jp/HOTEL/#{rakuten_travel_hotel_id}/review.html")
27
27
  sleep 2
28
28
  comment_area = driver.find_elements(:class_name, "commentReputationBoth")
29
29
  comment_area.map do |f|
@@ -38,17 +38,20 @@ module HotelPrice
38
38
 
39
39
  protected
40
40
 
41
- def self.get_selenium_driver(mode = 0)
41
+ def self.get_selenium_driver(mode = :chrome)
42
42
  case mode
43
- when 1
43
+ when :firefox_remote_capabilities
44
44
  firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
45
45
  Selenium::WebDriver.for(:remote, url: "http://hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
46
- when 2
46
+ when :firefox
47
47
  Selenium::WebDriver.for :firefox
48
48
  else
49
- options = Selenium::WebDriver::Firefox::Options.new
49
+ options = Selenium::WebDriver::Chrome::Options.new
50
+ options.add_argument("--ignore-certificate-errors")
51
+ options.add_argument("--disable-popup-blocking")
52
+ options.add_argument("--disable-translate")
50
53
  options.add_argument("-headless")
51
- Selenium::WebDriver.for :firefox, options: options
54
+ Selenium::WebDriver.for :chrome, options: options
52
55
  end
53
56
  end
54
57
 
@@ -58,6 +61,7 @@ module HotelPrice
58
61
  # Agoda API key
59
62
  # @param [String]
60
63
  attr_accessor :agoda_api_key
64
+ attr_accessor :selenium_driver
61
65
 
62
66
  def initialize
63
67
  @agoda_api_key = nil
@@ -2,12 +2,18 @@ require "date"
2
2
 
3
3
  module HotelPrice::Agoda
4
4
  class AgodaScraper
5
- def self.get_price(agoda_hotel_id, checkin_date, num_adults, mode = 0)
5
+ @mode
6
+
7
+ def initialize(mode = :chrome)
8
+ @mode = mode
9
+ end
10
+
11
+ def get_price(agoda_hotel_id, checkin_date, num_adults)
6
12
  date = DateTime.now.strftime("%Y-%m-%d")
7
13
 
8
14
  query_string = make_query_string(checkin_date.to_s, num_adults)
9
15
  url = "https://www.agoda.com/ja-jp/#{agoda_hotel_id}.html?#{query_string}"
10
- driver = HotelPrice.get_selenium_driver mode
16
+ driver = HotelPrice.get_selenium_driver @mode
11
17
  driver.get(url)
12
18
  sleep 2
13
19
 
@@ -23,23 +29,23 @@ module HotelPrice::Agoda
23
29
  room_name_element = driver.find_elements(:xpath, "//span[@data-selenium='masterroom-title-name']")
24
30
  room_name = room_name_element.first.text unless room_name_element.empty?
25
31
 
26
- { date: date, min_price: price, hotel_name: hotel_name, room_name: room_name }
32
+ { checkin_date: checkin_date, min_price: price, hotel_name: hotel_name, room_name: room_name }
27
33
  end
28
34
 
29
- def self.make_query_string(checkin_date, num_adults)
35
+ def make_query_string(checkin_date, num_adults)
30
36
  cd_args = make_date_args checkin_date
31
37
  na_args = make_num_adults_arg num_adults
32
38
  "#{cd_args}&#{na_args}&rooms=1&travellerType=-1"
33
39
  end
34
40
 
35
- def self.make_date_args checkin_date
41
+ def make_date_args checkin_date
36
42
  Date.parse checkin_date rescue return ""
37
43
  t = Date.parse(checkin_date)
38
44
  checkin_arg = t.strftime("checkIn=%Y-%m-%d")
39
45
  "#{checkin_arg}&los=2"
40
46
  end
41
47
 
42
- def self.make_num_adults_arg num_adults
48
+ def make_num_adults_arg num_adults
43
49
  return "" if num_adults.to_i <= 1
44
50
  "adults=#{num_adults}"
45
51
  end
@@ -2,13 +2,18 @@ require "date"
2
2
 
3
3
  module HotelPrice::Booking
4
4
  class BookingScraper
5
+ @mode
5
6
 
6
- def self.get_price(booking_hotel_id, checkin_date, num_adults, mode = 0)
7
+ def initialize(mode = :chrome)
8
+ @mode = mode
9
+ end
10
+
11
+ def get_price(booking_hotel_id, checkin_date, num_adults)
7
12
  date = DateTime.now.strftime("%Y-%m-%d")
8
13
 
9
14
  query_string = make_query_string(checkin_date.to_s, num_adults)
10
15
  url = "https://www.booking.com/hotel/jp/#{booking_hotel_id}.ja.html?#{query_string}"
11
- driver = HotelPrice.get_selenium_driver mode
16
+ driver = HotelPrice.get_selenium_driver @mode
12
17
  driver.get(url)
13
18
  sleep 2
14
19
 
@@ -26,16 +31,16 @@ module HotelPrice::Booking
26
31
  room_name_element = driver.find_elements(:class_name, "hprt-ws-roomtype-link")
27
32
  room_name = room_name_element.first.text unless room_name_element.empty?
28
33
 
29
- { date: date, min_price: price, hotel_name: hotel_name, room_name: room_name }
34
+ { checkin_date: checkin_date, min_price: price, hotel_name: hotel_name, room_name: room_name }
30
35
  end
31
36
 
32
- def self.make_query_string(checkin_date, num_adults)
37
+ def make_query_string(checkin_date, num_adults)
33
38
  cd_args = make_date_args checkin_date
34
39
  na_args = make_num_adults_arg num_adults
35
40
  "#{cd_args}&#{na_args}&dist=0&do_availability_check=1&hp_avform=1&hp_group_set=0&no_rooms=1&origin=hp&sb_price_type=total&src=hotel&tab=1&type=total&lang=ja&selected_currency=JPY"
36
41
  end
37
42
 
38
- def self.make_date_args checkin_date
43
+ def make_date_args checkin_date
39
44
  Date.parse checkin_date rescue return ""
40
45
  t = Date.parse(checkin_date)
41
46
  checkin_arg = t.strftime("checkin_monthday=%d&checkin_year_month=%Y-%m")
@@ -43,9 +48,9 @@ module HotelPrice::Booking
43
48
  "#{checkin_arg}&#{checkout_arg}"
44
49
  end
45
50
 
46
- def self.make_num_adults_arg num_adults
51
+ def make_num_adults_arg num_adults
47
52
  return "" if num_adults.to_i <= 1
48
53
  "group_adults=#{num_adults}&group_children=0"
49
54
  end
50
55
  end
51
- end
56
+ end
@@ -2,12 +2,18 @@ require "date"
2
2
 
3
3
  module HotelPrice::Expedia
4
4
  class ExpediaScraper
5
- def self.get_price(expedia_hotel_id, checkin_date, num_adults, mode = 0)
5
+ @mode
6
+
7
+ def initialize(mode = :chrome)
8
+ @mode = mode
9
+ end
10
+
11
+ def get_price(expedia_hotel_id, checkin_date, num_adults)
6
12
  date = DateTime.now.strftime("%Y-%m-%d")
7
13
 
8
14
  query_string = make_query_string(checkin_date.to_s, num_adults)
9
15
  url = "https://www.expedia.co.jp/ja/#{expedia_hotel_id}.Hotel-Information?#{query_string}"
10
- driver = HotelPrice.get_selenium_driver mode
16
+ driver = HotelPrice.get_selenium_driver @mode
11
17
  driver.get(url)
12
18
  sleep 2
13
19
 
@@ -23,16 +29,16 @@ module HotelPrice::Expedia
23
29
  room_name_element = driver.find_elements(:xpath, "//h3[@data-stid='room-info-title-heading']")
24
30
  room_name = room_name_element.first.text unless room_name_element.empty?
25
31
 
26
- { date: date, min_price: price, hotel_name: hotel_name, room_name: room_name }
32
+ { checkin_date: checkin_date, min_price: price, hotel_name: hotel_name, room_name: room_name }
27
33
  end
28
34
 
29
- def self.make_query_string(checkin_date, num_adults)
35
+ def make_query_string(checkin_date, num_adults)
30
36
  cd_args = make_date_args checkin_date
31
37
  na_args = make_num_adults_arg num_adults
32
38
  "#{cd_args}&#{na_args}&x_pwa=1&rfrr=HSR&pwa_ts=1583335742618&swpToggleOn=true&regionId=3250&destination=Sapporo%2C+Hokkaido%2C+Japan&destType=MARKET&neighborhoodId=6290332&selected=5224778&sort=recommended&top_dp=5686&top_cur=JPY"
33
39
  end
34
40
 
35
- def self.make_date_args checkin_date
41
+ def make_date_args checkin_date
36
42
  Date.parse checkin_date rescue return ""
37
43
  t = Date.parse(checkin_date)
38
44
  checkin_arg = t.strftime("chkin=%Y-%m-%d")
@@ -40,7 +46,7 @@ module HotelPrice::Expedia
40
46
  "#{checkin_arg}&#{checkout_arg}"
41
47
  end
42
48
 
43
- def self.make_num_adults_arg num_adults
49
+ def make_num_adults_arg num_adults
44
50
  return "" if num_adults.to_i <= 1
45
51
  "rm1=a#{num_adults}"
46
52
  end
@@ -0,0 +1,41 @@
1
+ module HotelPrice::Jalan
2
+ require "nokogiri"
3
+ require "open-uri"
4
+ class JalanAPI
5
+ def initialize params
6
+ @config = {
7
+ jalan_hotel_id: params[:jalan_hotel_id] ||= 0,
8
+ jalan_api_key: params[:jalan_api_key] ||= ENV["JALAN_API_KEY"]
9
+ }
10
+ end
11
+
12
+ def test
13
+ @config[:jalan_api_key]
14
+ end
15
+
16
+ def get_min_price params
17
+ url = "http://jws.jalan.net/APIAdvance/StockSearch/V1/?key=#{@config[:jalan_api_key]}&h_id=#{@config[:jalan_hotel_id]}&stay_date=#{params[:checkin_date]}&stay_count=1&adult_num=#{params[:adult_num]}&count=1"
18
+ doc = Nokogiri::XML(open(url))
19
+ if doc.css("NumberOfResults").text == "0"
20
+ {
21
+ date: DateTime.now.strftime("%Y-%m-%d"),
22
+ jalan_hotel_id: @config[:jalan_hotel_id],
23
+ checkin_date: params[:checkin_date],
24
+ plan_num: 0,
25
+ min_price: 0
26
+ }
27
+ else
28
+ {
29
+ date: DateTime.now.strftime("%Y-%m-%d"),
30
+ jalan_hotel_id: @config[:jalan_hotel_id],
31
+ checkin_date: params[:checkin_date],
32
+ hotel_name: doc.css("Plan").css("Hotel HotelName").text,
33
+ room_name: doc.css("Plan").css("RoomName").text,
34
+ plan_name: doc.css("Plan").css("PlanName").text,
35
+ plan_num: doc.css("NumberOfResults").text,
36
+ min_price: doc.css("Plan").css("Stay Rate").text
37
+ }
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,12 @@
1
+ module HotelPrice::Jalan
2
+ class JalanConsole
3
+ def initialize params
4
+ @config = {
5
+ login_id: params[:login_id],
6
+ login_pw: params[:login_pw],
7
+ chain: params[:chain] ||= false,
8
+ jalan_hotel_id: params[:jalan_hotel_id] ||= 0
9
+ }
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,53 @@
1
+ module HotelPrice::Jalan
2
+ class JalanScraper
3
+ @mode
4
+
5
+ def initialize(mode = :chrome)
6
+ @mode = mode
7
+ end
8
+
9
+ def get_price(jalan_hotel_id, checkin_date, num_adults)
10
+ date = DateTime.now.strftime("%Y-%m-%d")
11
+
12
+ query_string = make_query_string(checkin_date.to_s, num_adults)
13
+ url = "https://www.jalan.net/yad#{jalan_hotel_id}/plan/?screenId=UWW3101&yadNo=#{jalan_hotel_id}&#{query_string}"
14
+ driver = HotelPrice.get_selenium_driver @mode
15
+ driver.get(url)
16
+ sleep 2
17
+ @price_box = []
18
+ driver.find_elements(class_name: "p-planCassette").each do |f|
19
+ rows = f.find_elements(:xpath, "//tr")
20
+ rows.each do |e|
21
+ @price_box << {
22
+ date: date,
23
+ min_price: e.find_element(class_name: "p-searchResultItem__total").text.delete("^0-9").to_i,
24
+ hotel_name: driver.find_element(id: "yado_header_hotel_name").text,
25
+ room_name: e.find_element(class_name: "p-searchResultItem__planName").text,
26
+ plan_name: f.find_element(class_name: "p-planCassette__header").text
27
+ }
28
+ rescue StandardError
29
+ { date: date, min_price: 0 }
30
+ end
31
+ end
32
+ @price_box.sort_by { |_a, _b, c| c }.reverse.first || { date: date, min_price: 0 }
33
+ rescue StandardError
34
+ { date: date, min_price: 0 }
35
+ end
36
+
37
+ def make_query_string(checkin_date, num_adults)
38
+ cd_args = make_date_args checkin_date
39
+ na_args = make_num_adults_arg num_adults
40
+ "rootCd=7701&callbackHistFlg=1&contHideFlg=1&reSearchFlg=1&roomCrack=100000&smlCd=121108&distCd=01&#{cd_args}&stayCount=1&roomCount=1&#{na_args}&minPrice=0&maxPrice=999999"
41
+ end
42
+
43
+ def make_date_args checkin_date
44
+ Date.parse checkin_date rescue return ""
45
+ Date.parse(checkin_date).strftime("stayYear=%Y&stayMonth=%m&stayDay=%d")
46
+ end
47
+
48
+ def make_num_adults_arg num_adults
49
+ return "" if num_adults.to_i < 1
50
+ "adultNum=#{num_adults}"
51
+ end
52
+ end
53
+ end
@@ -1,11 +1,17 @@
1
1
  module HotelPrice::Jalan
2
2
  class JalanScraper
3
- def self.get_price(jalan_hotel_id, checkin_date, num_adults, mode = 0)
3
+ @mode
4
+
5
+ def initialize(mode = :chrome)
6
+ @mode = mode
7
+ end
8
+
9
+ def get_price(jalan_hotel_id, checkin_date, num_adults)
4
10
  date = DateTime.now.strftime("%Y-%m-%d")
5
11
 
6
12
  query_string = make_query_string(checkin_date.to_s, num_adults)
7
13
  url = "https://www.jalan.net/yad#{jalan_hotel_id}/plan/?screenId=UWW3101&yadNo=#{jalan_hotel_id}&#{query_string}"
8
- driver = HotelPrice.get_selenium_driver mode
14
+ driver = HotelPrice.get_selenium_driver @mode
9
15
  driver.get(url)
10
16
  sleep 2
11
17
  @price_box = []
@@ -20,25 +26,26 @@ module HotelPrice::Jalan
20
26
  plan_name: f.find_element(class_name: "p-planCassette__header").text
21
27
  }
22
28
  rescue StandardError
29
+ { date: date, min_price: 0 }
23
30
  end
24
31
  end
25
- @price_box.sort_by { |_a, _b, c| c }.reverse.first
32
+ @price_box.sort_by { |_a, _b, c| c }.reverse.first || { date: date, min_price: 0 }
26
33
  rescue StandardError
27
34
  { date: date, min_price: 0 }
28
35
  end
29
36
 
30
- def self.make_query_string(checkin_date, num_adults)
37
+ def make_query_string(checkin_date, num_adults)
31
38
  cd_args = make_date_args checkin_date
32
39
  na_args = make_num_adults_arg num_adults
33
40
  "rootCd=7701&callbackHistFlg=1&contHideFlg=1&reSearchFlg=1&roomCrack=100000&smlCd=121108&distCd=01&#{cd_args}&stayCount=1&roomCount=1&#{na_args}&minPrice=0&maxPrice=999999"
34
41
  end
35
42
 
36
- def self.make_date_args checkin_date
43
+ def make_date_args checkin_date
37
44
  Date.parse checkin_date rescue return ""
38
45
  Date.parse(checkin_date).strftime("stayYear=%Y&stayMonth=%m&stayDay=%d")
39
46
  end
40
47
 
41
- def self.make_num_adults_arg num_adults
48
+ def make_num_adults_arg num_adults
42
49
  return "" if num_adults.to_i < 1
43
50
  "adultNum=#{num_adults}"
44
51
  end
@@ -2,7 +2,7 @@ module HotelPrice::Rakuten
2
2
  class RakutenAPI
3
3
  def initialize params
4
4
  @config = {
5
- rakuten_hotel_id: params[:rakuten_hotel_id] ||= 0,
5
+ rakuten_hotel_id: params[:rakuten_hotel_id].to_s ||= 0,
6
6
  rakuten_api_key: params[:rakuten_api_key] ||= ENV["RT_API_KEY"]
7
7
  }
8
8
  end
@@ -45,56 +45,7 @@ module HotelPrice::Rakuten
45
45
  "format=json&sort=%2BroomCharge&searchPattern=1&applicationId=#{@config[:rakuten_api_key]}&hotelNo=#{rakuten_hotel_id}&adultNum=#{num_adults}&checkinDate=#{checkin_date}&checkoutDate=#{checkout_date}&squeezeCondition="
46
46
  end
47
47
 
48
- def get_min_price params
49
- params[:breakfast] ||= ""
50
- try = 0
51
- begin
52
- base_url = "https://app.rakuten.co.jp/services/api/Travel/VacantHotelSearch/20131024?format=json&sort=%2BroomCharge&searchPattern=1"
53
- url = [base_url, "&applicationId=", @config[:rakuten_api_key], "&adultNum=", params[:adult_num].to_s, "&checkinDate=", params[:checkin_date].to_s, "&checkoutDate=", (Date.parse(params[:checkin_date]) + 1).strftime("%Y-%m-%d"), "&hotelNo=", @config[:rakuten_hotel_id].to_s, "&squeezeCondition=", params[:breakfast]].join
54
- json = Net::HTTP.get(URI.parse(url))
55
- result = JSON.parse(json)
56
- try = 0
57
- begin
58
- data_hash = if result["error"] == "not_found"
59
- {
60
- date: DateTime.now.strftime("%Y-%m-%d"),
61
- checkin_date: params[:checkin_date],
62
- rakuten_hotel_id: params[:rakuten_hotel_id],
63
- adult_num: params[:adult_num],
64
- breakfast: params[:breakfast],
65
- plan_num: 0,
66
- min_price: 0
67
- }
68
- elsif result["error"] == "wrong_parameterd"
69
- "入力した値が正しくありません。"
70
- else
71
- {
72
- date: DateTime.now.strftime("%Y-%m-%d"),
73
- checkin_date: result["hotels"][0]["hotel"][1]["roomInfo"][1]["dailyCharge"]["stayDate"],
74
- rakuten_hotel_id: params[:rakuten_hotel_id],
75
- hotel_name: result["hotels"][0]["hotel"][0]["hotelBasicInfo"]["hotelName"],
76
- adult_num: params[:adult_num],
77
- breakfast: params[:breakfast],
78
- plan_num: result["pagingInfo"]["recordCount"],
79
- room_name: result["hotels"][0]["hotel"][1]["roomInfo"][0]["roomBasicInfo"]["roomName"],
80
- plan_name: result["hotels"][0]["hotel"][1]["roomInfo"][0]["roomBasicInfo"]["planName"],
81
- min_price: result["hotels"][0]["hotel"][1]["roomInfo"][1]["dailyCharge"]["rakutenCharge"]
82
- }
83
- end
84
- rescue StandardError => e
85
- try += 1
86
- sleep 2
87
- puts "エラー発生。リトライします。\n #{e.message}"
88
- retry if try < 5
89
- end
90
- rescue StandardError => e
91
- try += 1
92
- sleep 5
93
- retry if try < 5
94
- end
95
- data_hash
96
- end
97
-
48
+
98
49
  def hotel_info
99
50
  uri = URI.parse("https://app.rakuten.co.jp/services/api/Travel/HotelDetailSearch/20131024?hotelNo=" + @config[:rakuten_hotel_id].to_s + "&applicationId=" + @config[:rakuten_api_key].to_s + "&datumType=1&responseType=large")
100
51
  json = Net::HTTP.get(uri)
@@ -6,7 +6,7 @@ module HotelPrice::Rakuten
6
6
  login_pw: params[:login_pw],
7
7
  chain: params[:chain] ||= false,
8
8
  rakuten_hotel_id: params[:rakuten_hotel_id] ||= 0,
9
- mode: params[:mode] ||= 0
9
+ mode: params[:mode] ||= :chrome
10
10
  }
11
11
  @wait = Selenium::WebDriver::Wait.new(timeout: 100)
12
12
  @driver = HotelPrice.get_selenium_driver @config[:mode]
@@ -320,14 +320,12 @@ module HotelPrice::Rakuten
320
320
  def login_check
321
321
  exp = @driver.find_element(:xpath, "/html/body/table[1]/tbody/tr[1]/td/table/tbody/tr/td[5]/table/tbody/tr[1]/td").text.gsub("次回パスワード更新日:", "").gsub("※事前にパスワードを変更されたい場合はこちらをご参照ください。\n", "")
322
322
  rakuten_hotel_id = @driver.find_element(:xpath, "/html/body/table[1]/tbody/tr[1]/td/table/tbody/tr/td[2]/table/tbody/tr/td").text.gsub("施設番号 : ", "").split("\n")[0]
323
- @driver.quit
324
323
  {
325
324
  status: "success",
326
325
  password_exp_date: exp,
327
326
  rakuten_hotel_id: rakuten_hotel_id
328
327
  }
329
328
  rescue StandardError => e
330
- @driver.quit
331
329
  {
332
330
  status: "error",
333
331
  error: e.to_s
@@ -462,7 +460,6 @@ module HotelPrice::Rakuten
462
460
  # end
463
461
 
464
462
  def daily_data
465
- puts "start"
466
463
  @driver.find_element(:xpath, "/html/body/table[2]/tbody/tr/td[3]/table[2]/tbody/tr[1]/td[1]/table/tbody/tr/td[3]/a/img").click
467
464
  @driver.find_element(:xpath, "/html/body/table[2]/tbody/tr/td[3]/table[5]/tbody/tr[2]/td[1]/table/tbody/tr[3]/td/table/tbody/tr/td[1]/input").click
468
465
  sleep 3
@@ -476,7 +473,6 @@ module HotelPrice::Rakuten
476
473
  select = Selenium::WebDriver::Support::Select.new(@driver.find_element(:name, "f_date"))
477
474
  select.select_by(:value, value)
478
475
  end
479
- puts "scraper"
480
476
  @driver.find_element(:xpath, '//input[@value = "表示"]').click
481
477
  rows = @driver.find_elements(:xpath, "//tr")
482
478
  data = []
@@ -3,12 +3,18 @@ module HotelPrice::Rakuten
3
3
  ## mode 1 - docker selenium
4
4
  ## mode 2 - debug
5
5
  class RakutenScraper
6
- def self.get_price(rakuten_hotel_id, checkin_date, num_adults, mode = 0)
6
+ @mode
7
+
8
+ def initialize(mode = :chrome)
9
+ @mode = mode
10
+ end
11
+
12
+ def get_price(rakuten_hotel_id, checkin_date, num_adults)
7
13
  date = DateTime.now.strftime("%Y-%m-%d")
8
14
 
9
15
  query_string = make_query_string(checkin_date.to_s, num_adults)
10
16
  url = "https://hotel.travel.rakuten.co.jp/hotelinfo/plan/#{rakuten_hotel_id}?#{query_string}"
11
- driver = HotelPrice.get_selenium_driver mode
17
+ driver = HotelPrice.get_selenium_driver @mode
12
18
  driver.get(url)
13
19
  sleep 2
14
20
  driver.find_elements(class_name: "planThumb").first rescue return ""
@@ -22,13 +28,13 @@ module HotelPrice::Rakuten
22
28
  { date: date, min_price: 0 }
23
29
  end
24
30
 
25
- def self.make_query_string(checkin_date, num_adults)
31
+ def make_query_string(checkin_date, num_adults)
26
32
  cd_args = make_date_args checkin_date
27
33
  na_args = make_num_adults_arg num_adults
28
34
  "f_teikei=quick&f_hizuke=&f_hak=&f_dai=japan&f_chu=tokyo&f_shou=nishi&f_sai=&f_tel=&f_target_flg=&f_tscm_flg=&f_p_no=&f_custom_code=&f_search_type=&f_camp_id=&f_static=1&f_rm_equip=&#{cd_args}&f_heya_su=1&#{na_args}"
29
35
  end
30
36
 
31
- def self.make_date_args checkin_date
37
+ def make_date_args checkin_date
32
38
  Date.parse checkin_date rescue return ""
33
39
  t = Date.parse(checkin_date)
34
40
  checkin_arg = t.strftime("f_hi1=%d&f_tuki1=%m&f_nen1=%Y")
@@ -36,13 +42,13 @@ module HotelPrice::Rakuten
36
42
  "#{checkin_arg}&#{checkout_arg}"
37
43
  end
38
44
 
39
- def self.make_num_adults_arg num_adults
45
+ def make_num_adults_arg num_adults
40
46
  return "" if num_adults.to_i <= 1
41
47
  "f_otona_su=#{num_adults}&f_kin2=0&f_kin=&f_s1=0&f_s2=0&f_y1=0&f_y2=0&f_y3=0&f_y4=0"
42
48
  end
43
49
 
44
- def self.review rakuten_hotel_id, mode = 0
45
- driver = HotelPrice.get_selenium_driver mode
50
+ def review rakuten_hotel_id
51
+ driver = HotelPrice.get_selenium_driver @mode
46
52
  driver.get("https://travel.rakuten.co.jp/HOTEL/#{rakuten_hotel_id}/review.html")
47
53
  sleep 2
48
54
  comment_area = driver.find_elements(:class_name, "commentBox")
@@ -70,8 +76,8 @@ module HotelPrice::Rakuten
70
76
  data
71
77
  end
72
78
 
73
- def self.get_photo_num rakuten_hotel_id, mode = 0
74
- driver = HotelPrice.get_selenium_driver mode
79
+ def get_photo_num rakuten_hotel_id
80
+ driver = HotelPrice.get_selenium_driver @mode
75
81
  driver.get "https://hotel.travel.rakuten.co.jp/hinfo/#{rakuten_hotel_id}/"
76
82
  sleep 2
77
83
  num = driver.find_element(:id, "navPht").text.gsub("写真・動画(", "").gsub(")", "").to_i
@@ -79,31 +85,28 @@ module HotelPrice::Rakuten
79
85
  num
80
86
  end
81
87
 
82
- def self.get_bf_plan_num rakuten_hotel_id, mode = 0
83
- driver = HotelPrice.get_selenium_driver mode
88
+ def get_bf_plan_num rakuten_hotel_id
89
+ driver = HotelPrice.get_selenium_driver @mode
84
90
  driver.get "https://hotel.travel.rakuten.co.jp/hotelinfo/plan/#{rakuten_hotel_id}"
85
91
  driver.find_element(:id, "focus1").click
86
92
  driver.find_element(:id, "dh-squeezes-submit").click
87
- sleep 30
93
+ sleep 3
88
94
  plan_num = driver.find_elements(:class, "planThumb")
89
95
  driver.quit
90
96
  plan_num.size
91
97
  end
92
98
 
93
- def self.get_dayuse_plan_num rakuten_hotel_id, mode = 0
94
- driver = HotelPrice.get_selenium_driver mode
95
- driver.get "https://hotel.travel.rakuten.co.jp/hotelinfo/plan/#{rakuten_hotel_id}"
96
- sleep 10
97
- driver.find_element(:id, "du-radio").click
98
- driver.find_element(:id, "dh-submit").click
99
- sleep 10
99
+ def get_dayuse_plan_num rakuten_hotel_id
100
+ driver = HotelPrice.get_selenium_driver @mode
101
+ driver.get "https://hotel.travel.rakuten.co.jp/hotelinfo/dayuse/?f_no=#{rakuten_hotel_id}"
102
+ sleep 5
100
103
  plan_num = driver.find_elements(:class, "planThumb")
101
104
  driver.quit
102
105
  plan_num.size
103
106
  end
104
107
 
105
- def self.get_detail_class_code rakuten_hotel_id, mode = 0
106
- driver = HotelPrice.get_selenium_driver mode
108
+ def get_detail_class_code rakuten_hotel_id
109
+ driver = HotelPrice.get_selenium_driver @mode
107
110
  driver.get "https://hotel.travel.rakuten.co.jp/hinfo/?f_no=#{rakuten_hotel_id}"
108
111
  {
109
112
  status: "found",
@@ -1,3 +1,3 @@
1
1
  module HotelPrice
2
- VERSION = "0.5.4"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotel_price
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fumitake Kawasaki
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-04-14 00:00:00.000000000 Z
12
+ date: 2020-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -45,70 +45,70 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '3.0'
48
+ version: 3.9.0
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '3.0'
55
+ version: 3.9.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: activesupport
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 6.0.2.1
62
+ version: 6.0.2.2
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 6.0.2.1
69
+ version: 6.0.2.2
70
70
  - !ruby/object:Gem::Dependency
71
- name: nokogiri
71
+ name: json
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 1.10.9
76
+ version: 2.3.1
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: 1.10.9
83
+ version: 2.3.1
84
84
  - !ruby/object:Gem::Dependency
85
- name: selenium-webdriver
85
+ name: nokogiri
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '3.141'
90
+ version: 1.10.9
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '3.141'
97
+ version: 1.10.9
98
98
  - !ruby/object:Gem::Dependency
99
- name: json
99
+ name: selenium-webdriver
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: 2.3.0
104
+ version: '3.141'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: 2.3.0
111
+ version: '3.141'
112
112
  description: 'Empower World Travel Information Technology '
113
113
  email:
114
114
  - fumitake.kawasaki@el-soul.com
@@ -118,7 +118,6 @@ executables:
118
118
  extensions: []
119
119
  extra_rdoc_files: []
120
120
  files:
121
- - ".DS_Store"
122
121
  - ".gitignore"
123
122
  - ".rspec"
124
123
  - ".rubocop.yml"
@@ -143,6 +142,9 @@ files:
143
142
  - lib/hotel_price/configuration.rb
144
143
  - lib/hotel_price/expedia.rb
145
144
  - lib/hotel_price/expedia/expedia_scraper.rb
145
+ - lib/hotel_price/expedia/jalan/jalan_api.rb
146
+ - lib/hotel_price/expedia/jalan/jalan_console.rb
147
+ - lib/hotel_price/expedia/jalan/jalan_scraper.rb
146
148
  - lib/hotel_price/jalan.rb
147
149
  - lib/hotel_price/jalan/jalan_api.rb
148
150
  - lib/hotel_price/jalan/jalan_console.rb
@@ -152,13 +154,13 @@ files:
152
154
  - lib/hotel_price/rakuten/rakuten_console.rb
153
155
  - lib/hotel_price/rakuten/rakuten_scraper.rb
154
156
  - lib/hotel_price/version.rb
155
- homepage: https://github.com/el-fudo/hotel_price
157
+ homepage: https://github.com/elsoul/hotel_price
156
158
  licenses:
157
159
  - MIT
158
160
  metadata:
159
- source_code_uri: https://github.com/el-fudo/hotel_price
160
- homepage_uri: https://github.com/el-fudo/hotel_price
161
- changelog_uri: https://github.com/el-fudo/hotel_price
161
+ source_code_uri: https://github.com/elsoul/hotel_price
162
+ homepage_uri: https://github.com/elsoul/hotel_price
163
+ changelog_uri: https://github.com/elsoul/hotel_price
162
164
  post_install_message:
163
165
  rdoc_options: []
164
166
  require_paths:
@@ -167,14 +169,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
169
  requirements:
168
170
  - - ">="
169
171
  - !ruby/object:Gem::Version
170
- version: '0'
172
+ version: 2.7.0
171
173
  required_rubygems_version: !ruby/object:Gem::Requirement
172
174
  requirements:
173
175
  - - ">="
174
176
  - !ruby/object:Gem::Version
175
177
  version: '0'
176
178
  requirements: []
177
- rubygems_version: 3.0.3
179
+ rubygems_version: 3.1.4
178
180
  signing_key:
179
181
  specification_version: 4
180
182
  summary: Scraping Library to get world hotel price
data/.DS_Store DELETED
Binary file