lita-onewheel-amazon-product 0.1.1 → 0.2.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: cdfa78631be91a47c8287d2cd37a9ef44038e6ca
4
- data.tar.gz: 21b87bcf144ceedadb565fac1b2593caaadfdf2f
3
+ metadata.gz: f98b72ecf3b47998dd6d9e0f679e0f789c8d142a
4
+ data.tar.gz: 73adedab333f48bfcb45c74302808866c0f032d0
5
5
  SHA512:
6
- metadata.gz: 1d1269c7fc834901d0c801a699dd02701c9d42875149fecbfd037c4d2c96a07380afe110bdc6ab73b5471472eff0e0c6fb699a71a98c275a880c6a32fe37842b
7
- data.tar.gz: 5b9b7fab8a2bf6b17de9fce8bfc9a3f831191ac71ff8531908517bb7518e6b9031b6055cfd1a1e3dde2f91a3a636ead4fdcfd424dcbbc4d449fb76ec38a2a901
6
+ metadata.gz: feab464de042d61b60ef7b9a0069b9cb87757dc70c81168ffd6f5074be38fd066c15ab65b9aa43a16e45ff3be1e21205e659aad8c0fbf1f29bbb4710256d64ab
7
+ data.tar.gz: 0ddb056899b1af00670c00d2f100c9309d104ec8318f9886623dc5019136a8787be68091872086eb3fe1794b682f90f9caeb5da076e9171a98a93ef6854c0764
@@ -16,7 +16,7 @@ module Lita
16
16
  noko_doc = Nokogiri::HTML doc
17
17
  noko_doc.css('meta').each do |meta|
18
18
  attrs = meta.attributes
19
- if attrs['name'].to_s == 'description'
19
+ if attrs['name'].to_s == 'title'
20
20
  description = process_description attrs['content'].to_s
21
21
  end
22
22
  end
@@ -32,6 +32,10 @@ module Lita
32
32
  price_node = noko_doc.css('div#unqualifiedBuyBox .a-color-price')
33
33
  end
34
34
 
35
+ if price_node.empty?
36
+ price_node = noko_doc.css('div#buyNewSection span.a-color-price')
37
+ end
38
+
35
39
  unless price_node.empty?
36
40
  price = price_node.first.content.to_s
37
41
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-amazon-product'
3
- spec.version = '0.1.1'
3
+ spec.version = '0.2.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,26 @@
1
+ <!doctype html>
2
+ <head>
3
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
4
+ <link rel="canonical" href="http://www.amazon.com/Live-Detroit-Without-Being-Jackass/dp/0996836705" />
5
+ <meta name="description" content="How To Live In Detroit Without Being A Jackass [Aaron Foley] on Amazon.com. *FREE* shipping on qualifying offers. Are you moving to Detroit because your rent is too high? Did you read somewhere that the only thing you needed to buy a house was the change in your couch cushions? Are you totally terrified about living in one of the most crime-plagued cities in the United States? Welcome to Detroit" />
6
+ <meta name="title" content="How To Live In Detroit Without Being A Jackass: Aaron Foley: 9780996836708: Amazon.com: Books" />
7
+ <meta name="keywords" content="Aaron Foley,How To Live In Detroit Without Being A Jackass,Belt Publishing,0996836705,Travel / Americas" />
8
+ <title>How To Live In Detroit Without Being A Jackass: Aaron Foley: 9780996836708: Amazon.com: Books</title>
9
+ <div id="buyNewSection" class="rbbHeader dp-accordion-row">
10
+ <h5>
11
+ <div class="a-row">
12
+ <div class="a-column a-span4 a-text-left a-nowrap">
13
+ <span class="a-text-bold">Buy New</span>
14
+ </div>
15
+ <div class="a-column a-span8 a-text-right a-span-last">
16
+ <div class="inlineBlock-display">
17
+ <span class="a-letter-space"></span>
18
+ <span class="a-size-medium a-color-price offer-price a-text-normal">$15.10</span>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </h5>
23
+ </div>
24
+ </body>
25
+
26
+ </html>
@@ -21,6 +21,6 @@ describe Lita::Handlers::OnewheelAmazonProduct, lita_handler: true do
21
21
  it 'puts book price' do
22
22
  mock_fixture('book_price')
23
23
  send_message ('http://www.amazon.com/Live-Detroit-Without-Being-Jackass/dp/0996836705')
24
- expect(replies.last).to eq('')
24
+ expect(replies.last).to eq('$15.10 How To Live In Detroit Without Being A Jackass')
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-amazon-product
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
@@ -151,6 +151,7 @@ files:
151
151
  - lib/lita-onewheel-amazon-product.rb
152
152
  - lib/lita/handlers/onewheel_amazon_product.rb
153
153
  - lita-onewheel-amazon-product.gemspec
154
+ - spec/fixtures/book_price.html
154
155
  - spec/fixtures/our_price.html
155
156
  - spec/fixtures/third_party_price.html
156
157
  - spec/lita/handlers/onewheel_amazon_product_spec.rb
@@ -181,6 +182,7 @@ signing_key:
181
182
  specification_version: 4
182
183
  summary: See above.
183
184
  test_files:
185
+ - spec/fixtures/book_price.html
184
186
  - spec/fixtures/our_price.html
185
187
  - spec/fixtures/third_party_price.html
186
188
  - spec/lita/handlers/onewheel_amazon_product_spec.rb