lita-onewheel-amazon-product 0.4.2 → 0.5.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
  SHA1:
3
- metadata.gz: e5da8ba0eac25f53bba9f98aaade8629399d59c3
4
- data.tar.gz: d72144f2cfcea759719014c2d1f01d7f63fe9087
3
+ metadata.gz: 69187fc6262c32d2a9f89dc7efb0bade62a77519
4
+ data.tar.gz: e459127c39e54536ed78a14a3b32591ae741bbae
5
5
  SHA512:
6
- metadata.gz: b8f62adc62955a72fa75e451cafb3ed90e0921b3b3f7989d30ee6b754e6839e4cffd5ea5096e02f85aa68e57372cf4df34dd70ef6fbefa0d5aadf29c1dd56c49
7
- data.tar.gz: a77d25e321e357205df661101f0d39bd34358888b65cf2d2969d80ed368243185f124f3ea3287d475f4f6c8ba631944de76da8b967fd9ad9b6208dd9d1a54ff1
6
+ metadata.gz: 0ea963d2fe6c8cd64146d9c3419082291c28113fcae98f3ee56488852e8ccb3d7e295865dcc95b6064b36a99646ddcc5b2527df7657ed2f8fcef55fa298e5c9a
7
+ data.tar.gz: 9d54f7e4cadf9f58bd63ebdf05c15c895d9e329155e260c59b0028168a88688cd8a0b7aa788a4e10814732e1bbee2e7fd5b79cc191c31ec3e45a612cf0baa3c4
@@ -53,9 +53,14 @@ module Lita
53
53
  price_node = noko_doc.css('td.dp-price-col span.a-color-price')
54
54
  end
55
55
 
56
+ if price_node.empty?
57
+ price_node = noko_doc.css('div#olp_feature_div span.a-color-price')
58
+ end
59
+
56
60
  unless price_node.empty?
57
61
  price = price_node.first.content.to_s
58
62
  end
63
+
59
64
  price
60
65
  end
61
66
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-amazon-product'
3
- spec.version = '0.4.2'
3
+ spec.version = '0.5.0'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{Lita interface to post information about amazon products.}
@@ -0,0 +1,19 @@
1
+
2
+ <!doctype html><html class="a-no-js" data-19ax5a9jf="dingo"><link rel="preconnect" href="http://z-ecx.images-amazon.com"><link rel="preconnect" href="http://g-ecx.images-amazon.com">
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
5
+ <link rel="canonical" href="http://www.amazon.com/Tamarack-Technologies-2400-Film-Scanner/dp/B00004TH24" />
6
+ <meta name="description" content="Amazon.com: Tamarack Technologies 2400 FS Film Scanner: Electronics" />
7
+ <meta name="title" content="Amazon.com: Tamarack Technologies 2400 FS Film Scanner: Electronics" />
8
+ <meta name="keywords" content="Tamarack Technologies 2400 FS Film Scanner,Tamarack,AX2400KIT" />
9
+ <title>Amazon.com: Tamarack Technologies 2400 FS Film Scanner: Electronics</title>
10
+ </head>
11
+ <body id="dp">
12
+ <div id="olp_feature_div" class="feature" data-feature-name="olp">
13
+ <div class="a-section a-spacing-small a-spacing-top-small">
14
+ <span class="olp-padding-right"><a href="/gp/offer-listing/B00004TH24/ref=dp_olp_new?ie=UTF8&amp;condition=new">1&nbsp;new</a>&nbsp;from&nbsp;<span class='a-color-price'>$159.99</span></span>
15
+ <span class="olp-padding-right"><a href="/gp/offer-listing/B00004TH24/ref=dp_olp_used?ie=UTF8&amp;condition=used">2&nbsp;used</a>&nbsp;from&nbsp;<span class='a-color-price'>$105.00</span></span>
16
+ </div>
17
+ </div>
18
+ </body>
19
+ </html>
@@ -53,4 +53,10 @@ describe Lita::Handlers::OnewheelAmazonProduct, lita_handler: true do
53
53
  send_message('http://www.amazon.com/dp/B0154LAIQU?psc=1')
54
54
  expect(replies.last).to eq nil
55
55
  end
56
+
57
+ it 'finds data on new and used third party prices' do
58
+ mock_fixture('film_scanner_price')
59
+ send_message('http://www.amazon.com/Tamarack-Technologies-2400-Film-Scanner/dp/B00004TH24')
60
+ expect(replies.last).to eq('$159.99 Tamarack Technologies 2400 FS Film Scanner')
61
+ end
56
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-amazon-product
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-14 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -153,6 +153,7 @@ files:
153
153
  - lita-onewheel-amazon-product.gemspec
154
154
  - spec/fixtures/55_gallons_of_lube_price.html
155
155
  - spec/fixtures/book_price.html
156
+ - spec/fixtures/film_scanner_price.html
156
157
  - spec/fixtures/infant_circumcision_price.html
157
158
  - spec/fixtures/kindle_book_price.html
158
159
  - spec/fixtures/our_price.html
@@ -187,6 +188,7 @@ summary: See above.
187
188
  test_files:
188
189
  - spec/fixtures/55_gallons_of_lube_price.html
189
190
  - spec/fixtures/book_price.html
191
+ - spec/fixtures/film_scanner_price.html
190
192
  - spec/fixtures/infant_circumcision_price.html
191
193
  - spec/fixtures/kindle_book_price.html
192
194
  - spec/fixtures/our_price.html