amazon-search 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/amazon-search.rb +2 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 312a257aab5e778a235e740b5dd61016223fdc88
|
4
|
+
data.tar.gz: 5480564be609f2ed9eca9ae85c8a94e4ed620fa4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef7b9e076bf03c36cff8726a74fd69808e3f980f78d226dd26ef76e150987f363cf87f444705d8a066ce2c4f1e6b68b1161fe032bdda13f07eabd16feaee4543
|
7
|
+
data.tar.gz: 703586f1341fa9d06f32d1cdb7c7a758a6e174e3125d4f28e0dfa60bd3c0c93ae19c60f8a08af5683dc1dbac812d22382265b69c23ccf5cc1e9879d63dc0beef
|
data/lib/amazon-search.rb
CHANGED
@@ -3,21 +3,9 @@
|
|
3
3
|
require 'mechanize'
|
4
4
|
require 'thor'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
if keywords.nil? # did user forget to enter in search keywords?
|
10
|
-
STDOUT.puts """
|
11
|
-
Please provide search keywords
|
12
|
-
|
13
|
-
Example Usage:
|
14
|
-
search watches
|
15
|
-
search books
|
16
|
-
search games
|
17
|
-
|
18
|
-
"""
|
19
|
-
else
|
6
|
+
puts "Example usage is 'search \"books\"' "
|
20
7
|
|
8
|
+
def search(keywords)
|
21
9
|
agent = Mechanize.new
|
22
10
|
main_page = agent.get("http://amazon.com")
|
23
11
|
search_form = main_page.form_with :name => "site-search" # find the search form in Amazon
|
@@ -102,6 +90,4 @@ else
|
|
102
90
|
end # ends pagination loop
|
103
91
|
|
104
92
|
puts "\n\n(end of search results)"
|
105
|
-
|
106
|
-
end # ends ARGV if statement
|
107
93
|
end
|