amazon-search 1.1.12 → 1.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: 355f781e4853394723ee59002ff04c5d3dc0c16a
4
- data.tar.gz: 8cc980b335de8dbf6a7ddfa02ce94239321cccfd
3
+ metadata.gz: 926a9458dfada7f776d237ef062df5417a8844ab
4
+ data.tar.gz: a5f8d92ff7e15f3caec347da18b35e2251595841
5
5
  SHA512:
6
- metadata.gz: 5c875771aac1ebf918c52ccb71f1e63fcb621d199f91a75a336cefd3487096c244ef90720d41586112523cbfea856729dbcf9842d2c06aae18da9ab84ae4d1f8
7
- data.tar.gz: c06035e2e81aa8bc8192b000c80c5e81571510dd2aa381c870b7376c058dc63999f7e6c4fe672a5fcb58d0ed27c55834a2709e6dd4135d57f683d6f9ef8579a3
6
+ metadata.gz: db4b59801f639a46740400dac687977cf284fd14833ca942eabf05d5cc5544f09c46f3b6c169d5c4dee6fbcb95203d83a2efb64ebb0d7fe70b34e1ce63b3b746
7
+ data.tar.gz: e27a6cec55a33aa2b1cc594ff71e2e1bbb9059cb5e741254e6530f937f7d8e7a05357c90c69f6d462bd7aaebfc5d7a3e531d1b35e3b4228b39008d6420e46cd1
data/Readme.rdoc CHANGED
@@ -12,12 +12,17 @@ This is a tool that does not require configuration of Amazon's API. The functio
12
12
 
13
13
  require 'amazon-search'
14
14
 
15
- # Search for products by keywords and store results
15
+ # Search for products by keyword string and store results
16
16
  Amazon::Search.find_products "ruby"
17
+ Amazon::Search.find_products "books"
18
+ Amazon::Search.find_products "games"
17
19
 
18
-
19
- # puts results
20
+ # After a search is complete, run this command
20
21
  Amazon::Search.display_results
22
+
23
+ == GOTCHAS
24
+
25
+ If you are unable to establish an HTTPS connection, this program will not work. 503 errors will occur and the search will fail. 90% of the time, a simply retry will fix the issue. Working on getting a fix soon!
21
26
 
22
27
  == MIT LICENSE
23
28
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = %q{amazon-search}
5
- gem.version = '1.1.12'
5
+ gem.version = '1.2.0'
6
6
  gem.date = '2015-09-18'
7
7
  gem.platform = Gem::Platform::RUBY
8
8
  gem.required_ruby_version = '>= 1.8'
data/lib/amazon-search.rb CHANGED
@@ -15,7 +15,7 @@ class Search
15
15
  search_results = agent.submit search_form # submits form
16
16
 
17
17
  #--------- scan each page and store the results ---------------------
18
- @product_divs = []
18
+ $product_divs = []
19
19
  page_num = 0
20
20
  next_page = agent.get(search_results.uri) # initial search results are the first page
21
21
 
@@ -26,7 +26,7 @@ class Search
26
26
  page_num += 1
27
27
  page = agent.get(next_page.uri) # load the next page
28
28
 
29
- @product_divs << page.search('//li[starts-with(@id, "result")]') # store the div of each product
29
+ $product_divs << page.search('//li[starts-with(@id, "result")]') # store the div of each product
30
30
 
31
31
  next_page_link = page.link_with text: /Next Page/ # find the next page link
32
32
  next_page = next_page_link.click unless page_num == last_page_num # click to next page unless on last page
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mason