amazomania 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5e1eed27496fcf85b8d2476481635a427ec2dc6a
4
+ data.tar.gz: 1dc11ce4c13adfe7840a7b69dd94ba22bce9ccd0
5
+ SHA512:
6
+ metadata.gz: e855e2b25f28c4447b2adbafde26e0ba93e02399b4de371a09a950ab007c6457f6c21da7e93dc89a4265d2d17d1b30f45f25e6892dc6af6d80ac109aaf8db402
7
+ data.tar.gz: e01f4ddef298dfe77f6970c3a93a77dd5dcd4dc296ef2aae84a02bf5e2a902365544f0ca11351b737507fe16005c756eff30708d655b62ce47876205bb4b742b
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.1
4
+ before_install: gem install bundler -v 1.11.2
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at takiya@toran.sakura.ne.jp. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in amazomania.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,30 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Osamu Takiya
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
23
+ このソフトウェアの著作権表示と、このライセンスの全文を、ソースコードの中や、
24
+ ソースコードに同梱したライセンス表示用の別ファイルなどに掲載してください。
25
+
26
+ このソフトウェアをコピーして使ったり、配布したり、変更を加えたり、
27
+ 変更を加えたものを配布したり、商用利用したり、有料で販売したり、自由に使って下さい。
28
+
29
+ このソフトウェアにはいかなる保証も付いていません。
30
+ このソフトウェアを利用したことで問題が起きた場合、作者は責任を負いません。
@@ -0,0 +1,76 @@
1
+ [![CircleCI](https://circleci.com/gh/corselia/amazomania/tree/master.svg?style=svg)](https://circleci.com/gh/corselia/amazomania/tree/master)
2
+
3
+ # Amazomania
4
+ - you can get product sales data of `amazon.co.jp`
5
+ - for example, lowest price, shop name, shipping price, condition and etc
6
+
7
+ ## Installation
8
+ ```bash
9
+ $ gem install 'amazomania'
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ #### basical format
15
+
16
+ ```ruby
17
+ require 'amazomania'
18
+
19
+ Amazomania.data(ASIN) #=> Array
20
+ ```
21
+
22
+ #### example
23
+
24
+ ```ruby
25
+ require 'amazomania'
26
+
27
+ sales_data = Amazomania.data("B01N06V253")
28
+ p sales_data
29
+ ```
30
+
31
+ #### return value example
32
+ ```ruby
33
+ sales_data = [
34
+ {
35
+ shop: "shop_a",
36
+ price: 100,
37
+ main_condition: "新品",
38
+ sub_condition: "新品",
39
+ shipping_price: 500,
40
+ amazon_point: 0
41
+ },
42
+ {
43
+ shop: "shop_b",
44
+ price: 500,
45
+ main_condition: "新品",
46
+ sub_condition: "新品",
47
+ shipping_price: 350,
48
+ amazon_point: 0
49
+ },
50
+ {
51
+ shop: "shop_c",
52
+ price: 1000,
53
+ main_condition: "中古品",
54
+ sub_condition: "非常に良い",
55
+ shipping_price: 150,
56
+ amazon_point: 0
57
+ }
58
+ ]
59
+ ```
60
+
61
+ ## Notes
62
+ - too many accesses in short time occurs `Amazon CAPTCHA` and you don't access product page
63
+ - if shipping price is different by living place, this result is based on Tokyo
64
+ - maybe available at `amazon.com`?
65
+ - when html code is changed, this gem runs incorrectly X-(
66
+
67
+ ## Development
68
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
69
+
70
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
71
+
72
+ ## Contributing
73
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/corselia/amazomania](https://github.com/corselia/amazomania). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
74
+
75
+ ## License
76
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'amazomania/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "amazomania"
8
+ spec.version = Amazomania::VERSION
9
+ spec.authors = ["Osamu Takiya"]
10
+ spec.email = ["takiya@toran.sakura.ne.jp"]
11
+
12
+ spec.summary = %q{get lowest product price at amazon.co.jp}
13
+ spec.description = %q{at amazon.co.jp, as any product, can get lowest price, shop name, shipping price...etc}
14
+ spec.homepage = "https://github.com/corselia/amazomania"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
+ # delete this section to allow pushing this gem to any host.
19
+ # if spec.respond_to?(:metadata)
20
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
21
+ # else
22
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
+ # end
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_development_dependency "bundler", "~> 1.11"
31
+ spec.add_development_dependency "rake", "~> 10.0"
32
+ spec.add_development_dependency "rspec", "~> 3.0"
33
+
34
+ spec.add_dependency "nokogiri"
35
+ spec.add_dependency "capybara"
36
+ spec.add_dependency "poltergeist"
37
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "amazomania"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,13 @@
1
+ machine:
2
+ timezone: Asia/Tokyo
3
+ ruby:
4
+ version: 2.3.1
5
+ dependencies:
6
+ pre:
7
+ - sudo apt-get update; sudo apt-get install libicu52
8
+ - curl --output /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic https://s3.amazonaws.com/circle-support-bucket/phantomjs/phantomjs-2.0.1-linux-x86_64-dynamic
9
+ - chmod a+x /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic
10
+ - sudo ln -s --force /home/ubuntu/bin/phantomjs-2.0.1-linux-x86_64-dynamic /usr/local/bin/phantomjs
11
+ test:
12
+ override:
13
+ - bundle exec rspec
@@ -0,0 +1,10 @@
1
+ require "amazomania/version"
2
+ require "amazomania/sales_data"
3
+
4
+ module Amazomania
5
+ extend SalesData
6
+
7
+ def self.data(asin)
8
+ sales_data(asin)
9
+ end
10
+ end
@@ -0,0 +1,19 @@
1
+ require 'capybara/poltergeist'
2
+ require 'amazomania/user_agent'
3
+
4
+ module CreateSession
5
+ include UserAgent
6
+
7
+ def create_session
8
+ ua = user_agent
9
+
10
+ Capybara.register_driver :poltergeist do |app|
11
+ Capybara::Poltergeist::Driver.new(app, :js_errors => false, :timeout => 60)
12
+ end
13
+ Capybara.javascript_driver = :poltergeist
14
+
15
+ session = Capybara::Session.new(:poltergeist)
16
+ session.driver.headers = { 'User-Agent' => ua }
17
+ session
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ module CreateUri
2
+ def all_type_product_uri(asin)
3
+ uri = "https://www.amazon.co.jp/gp/offer-listing/#{asin}/ref=olp_f_collectible?f_collectible=true&f_new=true&f_used=true"
4
+ end
5
+ end
@@ -0,0 +1,112 @@
1
+ require 'amazomania/scraping'
2
+
3
+ module ParseHtml
4
+ include Scraping
5
+
6
+ def parse_html(asin)
7
+ @nokogiried_doc = scraping(asin)
8
+ @shop_names = shop_names
9
+ @prices = prices
10
+ @main_conditions = main_conditions
11
+ @sub_conditions = sub_conditions
12
+ @shipping_prices = shipping_prices
13
+ @amazon_points = amazon_points
14
+ end
15
+
16
+ def shop_names
17
+ seller_count = 0
18
+ nodesets = @nokogiried_doc.xpath("//*/h3[@class='a-spacing-none olpSellerName']") # 浅くしないと Amazon のネイティブ出品 および Amazonプライム の場合が判別できない
19
+ shop_names = []
20
+ nodesets.each do |nodeset| # ネストがやや深い
21
+ if nodeset.to_s.include?("seller") # to_s するのはとても荒い調べ方
22
+ shop_name = @nokogiried_doc.xpath("//*/h3[@class='a-spacing-none olpSellerName']/span/a")[seller_count].inner_text
23
+ shop_names.push(shop_name)
24
+ seller_count += 1
25
+ elsif nodeset.to_s.include?("amazon.co.jp/shops/") # Amazonアウトレット の場合
26
+ shop_names.push("Amazonアウトレット")
27
+ else
28
+ shop_names.push("Amazon.co.jp") # Amazon のネイティブ出品 or Amazonプライム の場合
29
+ end
30
+ end
31
+ shop_names
32
+ end
33
+
34
+ def prices
35
+ nodesets = @nokogiried_doc.xpath("//*/span[@class='a-size-large a-color-price olpOfferPrice a-text-bold']")
36
+ prices = []
37
+ nodesets.each do |nodeset|
38
+ prices.push(nodeset.inner_text.lstrip.gsub(/[^\d]/, ""))
39
+ end
40
+ prices
41
+ end
42
+
43
+ def main_conditions
44
+ nodesets = @nokogiried_doc.xpath("//*/span[@class='a-size-medium olpCondition a-text-bold']")
45
+ main_conditions = []
46
+ nodesets.each do |nodeset|
47
+ condition_tmp = nodeset.inner_text.gsub(" ", "").gsub(/\n/, "")
48
+ if condition_tmp.to_s.include?("中古品") # to_s するのはとても荒い調べ方
49
+ main_condition = "中古品"
50
+ elsif
51
+ main_condition = nodeset.inner_text.gsub(" ", "").strip
52
+ end
53
+ main_conditions.push(main_condition)
54
+ end
55
+ main_conditions
56
+ end
57
+
58
+ def sub_conditions
59
+ nodesets = @nokogiried_doc.xpath("//*/span[@class='a-size-medium olpCondition a-text-bold']")
60
+ sub_conditions = []
61
+ nodesets.each do |nodeset|
62
+ condition_tmp = nodeset.inner_text.gsub(" ", "").gsub(/\n/, "")
63
+ if condition_tmp.to_s.include?("中古品") # to_s するのはとても荒い調べ方
64
+ condition_tmp =~ /中古品\-(.*)/
65
+ sub_condition = $1
66
+ else
67
+ sub_condition = "新品"
68
+ end
69
+ sub_conditions.push(sub_condition)
70
+ end
71
+ sub_conditions
72
+ end
73
+
74
+ def shipping_prices
75
+ nodesets = @nokogiried_doc.xpath("//span[@class='a-color-secondary']")
76
+ shipping_prices = []
77
+ nodesets.each do |nodeset|
78
+ if nodeset.to_s.include?("color: #990000;") # to_s するのはとても荒い調べ方
79
+ next
80
+ end
81
+ if nodeset.to_s.include?("olpShippingPrice")
82
+ shipping_price = nodeset.inner_text.chomp.gsub(" ", "").gsub(/(\r\n|\r|\n|\f)/,"")
83
+ shipping_price = shipping_price.gsub(/[^\d]/, "")
84
+ shipping_prices.push(shipping_price)
85
+ else
86
+ shipping_prices.push("0")
87
+ end
88
+ end
89
+ shipping_prices
90
+ end
91
+
92
+ def amazon_points
93
+ nodesets = @nokogiried_doc.xpath("//*/span[@class='a-color-secondary']")
94
+ amazon_points = []
95
+ next_nodeset_is_skipped = false
96
+ nodesets.each do |nodeset|
97
+ if next_nodeset_is_skipped
98
+ next_nodeset_is_skipped = false
99
+ next
100
+ end
101
+ if nodeset.to_s.include?("color: #990000;")
102
+ amazon_point = nodeset.inner_text
103
+ amazon_point = amazon_point.strip.gsub(/,/, '').sub(/([0-9]+)pt.*/, '\1')
104
+ amazon_points.push(amazon_point)
105
+ next_nodeset_is_skipped = true # 「ポイント」と「送料」に共通の class="a-color-secondary" ではポイントの方が先に来る
106
+ else
107
+ amazon_points.push("0")
108
+ end
109
+ end
110
+ amazon_points
111
+ end
112
+ end
@@ -0,0 +1,24 @@
1
+ require 'amazomania/parse_html'
2
+
3
+ module SalesData
4
+ include ParseHtml
5
+
6
+ def sales_data(asin)
7
+ parse_html(asin) #=> @shop_names, @prices, @main_conditions, @sub_conditions, @shipping_prices, @amazon_points
8
+ loop_count = @shop_names.length # not sexy
9
+ sales_data =[]
10
+
11
+ loop_count.times do |i|
12
+ sales_data << {
13
+ shop: @shop_names[i],
14
+ price: @prices[i],
15
+ main_condition: @main_conditions[i],
16
+ sub_condition: @sub_conditions[i],
17
+ shipping_price: @shipping_prices[i],
18
+ amazon_point: @amazon_points[i],
19
+ }
20
+ end
21
+
22
+ sales_data
23
+ end
24
+ end
@@ -0,0 +1,17 @@
1
+ require 'nokogiri'
2
+ require 'amazomania/create_uri'
3
+ require 'amazomania/create_session'
4
+
5
+ module Scraping
6
+ include CreateUri
7
+ include CreateSession
8
+
9
+ def scraping(asin)
10
+ uri = all_type_product_uri(asin)
11
+ session = create_session
12
+
13
+ session.visit(uri)
14
+ html = session.html
15
+ Nokogiri::HTML.parse(html, nil, "UTF-8")
16
+ end
17
+ end
@@ -0,0 +1,152 @@
1
+ module UserAgent
2
+ def user_agent
3
+ user_agents #=> define '@user_agents'
4
+ @user_agents[rand(@user_agents.length)]
5
+ end
6
+
7
+ def user_agents
8
+ # PC の Webブラウザ と 非PC の Webブラウザ とで戻ってくる HTML が異なるので注意する
9
+ @user_agents = [
10
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.77 Chrome/16.0.912.77 Safari/535.7",
11
+ "Mozilla/5.0 (X11; CrOS x86_64 7262.57.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.98 Safari/537.36",
12
+ "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0",
13
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22",
14
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; TNJB; rv:11.0) like Gecko",
15
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; yie11; rv:11.0) like Gecko",
16
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
17
+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0",
18
+ "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
19
+ "Mozilla/5.0 (Windows NT 6.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
20
+ "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
21
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
22
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
23
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586",
24
+ "Mozilla/5.0 (Windows NT 6.3; ARM; Trident/7.0; Touch; MALNJS; rv:11.0) like Gecko",
25
+ "Mozilla/5.0 (Windows NT 6.3; ARM; Trident/7.0; Touch; rv:11.0) like Gecko",
26
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; ASU2JS; rv:11.0) like Gecko",
27
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; LCJB; rv:11.0) like Gecko",
28
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MAARJS; rv:11.0) like Gecko",
29
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MAFSJS; rv:11.0) like Gecko",
30
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MALNJS; rv:11.0) like Gecko",
31
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MAMIJS; rv:11.0) like Gecko",
32
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MASPJS; rv:11.0) like Gecko",
33
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko",
34
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; MASPJS; rv:11.0) like Gecko",
35
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko",
36
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MASPJS; rv:11.0) like Gecko",
37
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko",
38
+ "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; Touch; rv:11.0) like Gecko",
39
+ "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko",
40
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; EIE10;JAJPMSN; rv:11.0) like Gecko",
41
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko",
42
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; BOIE9;ENUS; rv:11.0) like Gecko",
43
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; MANM; rv:11.0) like Gecko",
44
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; MDDCJS; rv:11.0) like Gecko",
45
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; NP06; rv:11.0) like Gecko",
46
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
47
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0; YTB730) like Gecko",
48
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko",
49
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; EIE11;JAJPWOL; rv:11.0) like Gecko",
50
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; EIE10;ENUSWOL; rv:11.0) like Gecko",
51
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MALCJS; rv:11.0) like Gecko",
52
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; MDDSJS; rv:11.0) like Gecko",
53
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; YJSG3; rv:11.0) like Gecko",
54
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; BOIE9;JAJP; rv:11.0) like Gecko",
55
+ "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",
56
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0",
57
+ "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0",
58
+ "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0",
59
+ "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0",
60
+ "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0",
61
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0",
62
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0",
63
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0",
64
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0",
65
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0",
66
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0",
67
+ "Mozilla/5.0 (Windows NT 6.1; rv:35.0) Gecko/20100101 Firefox/35.0",
68
+ "Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0",
69
+ "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0",
70
+ "Mozilla/5.0 (Windows NT 6.0; rv:35.0) Gecko/20100101 Firefox/35.0",
71
+ "Mozilla/5.0 (Windows NT 6.1; rv:28.0) Gecko/20100101 Firefox/28.0",
72
+ "Mozilla/5.0 (Windows NT 6.0; rv:19.0) Gecko/20100101 Firefox/19.0",
73
+ "Mozilla/5.0 (Windows NT 5.1; rv:35.0) Gecko/20100101 Firefox/35.0",
74
+ "Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20100101 Firefox/17.0",
75
+ "Mozilla/5.0 (Windows NT 5.0; rv:35.0) Gecko/20100101 Firefox/35.0",
76
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)",
77
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.1) Gecko/20061010 Firefox/2.0",
78
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9",
79
+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; ja-JP; rv:1.6) Gecko/20040206 Firefox/0.8",
80
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0",
81
+ "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0",
82
+ "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:36.0) Gecko/20100101 Firefox/36.0",
83
+ "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:34.0) Gecko/20100101 Firefox/34.0",
84
+ "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:33.0) Gecko/20100101 Firefox/33.0",
85
+ "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:20.0) Gecko/20100101 Firefox/20.0",
86
+ "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0",
87
+ "Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0",
88
+ "Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0",
89
+ "Mozilla/5.0 (X11; FreeBSD i386; rv:19.0) Gecko/20100101 Firefox/19.0",
90
+ "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.1) Gecko/20060203 Firefox/1.5.0.1",
91
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:35.0) Gecko/20100101 Firefox/35.0",
92
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:34.0) Gecko/20100101 Firefox/34.0",
93
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0",
94
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Firefox/24.0",
95
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:35.0) Gecko/20100101 Firefox/35.0",
96
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; ja-JP-mac; rv:1.8.1) Gecko/20061010 Firefox/2.0",
97
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; ja-JPM; rv:1.7.8) Gecko/20050511 Firefox/1.0.4",
98
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2",
99
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14",
100
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.74.9 (KHTML, like Gecko) Version/7.0.2 Safari/537.74.9",
101
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1",
102
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10",
103
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17",
104
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/6.1.6 Safari/537.78.2",
105
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.77.4 (KHTML, like Gecko) Version/6.1.5 Safari/537.77.4",
106
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/534.57.7 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.7",
107
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.59.10 (KHTML, like Gecko) Version/5.1.9 Safari/534.59.10",
108
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.58.2 (KHTML, like Gecko) Version/5.1.8 Safari/534.58.2",
109
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
110
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.54.16 (KHTML, like Gecko) Version/5.1.4 Safari/534.54.16",
111
+ "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ja-jp) AppleWebKit/418.9 (KHTML, like Gecko) Safari/419.3",
112
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36",
113
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
114
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36",
115
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36",
116
+ "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36",
117
+ "Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
118
+ "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2308.0 Safari/537.36",
119
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36",
120
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
121
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36",
122
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36",
123
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22",
124
+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.33 Safari/535.11",
125
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.53 Safari/537.36",
126
+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
127
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
128
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36",
129
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36",
130
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.93 Safari/537.36",
131
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36",
132
+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22",
133
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
134
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
135
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.99 Safari/537.36",
136
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/600.1.25 (KHTML, like Gecko)",
137
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
138
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36",
139
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
140
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
141
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
142
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.99 Safari/537.22",
143
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
144
+ "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
145
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36",
146
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36",
147
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko; Google Page Speed Insights) Chrome/27.0.1453 Safari/537.36",
148
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko; Google Page Speed Insights) Chrome/27.0.1453 Safari/537.36 GoogleBot/2.1",
149
+ "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5",
150
+ ]
151
+ end
152
+ end
@@ -0,0 +1,3 @@
1
+ module Amazomania
2
+ VERSION = "1.0.0".freeze
3
+ end
metadata ADDED
@@ -0,0 +1,149 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: amazomania
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Osamu Takiya
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nokogiri
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: capybara
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: poltergeist
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: at amazon.co.jp, as any product, can get lowest price, shop name, shipping
98
+ price...etc
99
+ email:
100
+ - takiya@toran.sakura.ne.jp
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".gitignore"
106
+ - ".rspec"
107
+ - ".travis.yml"
108
+ - CODE_OF_CONDUCT.md
109
+ - Gemfile
110
+ - LICENSE
111
+ - README.md
112
+ - Rakefile
113
+ - amazomania.gemspec
114
+ - bin/console
115
+ - bin/setup
116
+ - circle.yml
117
+ - lib/amazomania.rb
118
+ - lib/amazomania/create_session.rb
119
+ - lib/amazomania/create_uri.rb
120
+ - lib/amazomania/parse_html.rb
121
+ - lib/amazomania/sales_data.rb
122
+ - lib/amazomania/scraping.rb
123
+ - lib/amazomania/user_agent.rb
124
+ - lib/amazomania/version.rb
125
+ homepage: https://github.com/corselia/amazomania
126
+ licenses:
127
+ - MIT
128
+ metadata: {}
129
+ post_install_message:
130
+ rdoc_options: []
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ requirements: []
144
+ rubyforge_project:
145
+ rubygems_version: 2.5.1
146
+ signing_key:
147
+ specification_version: 4
148
+ summary: get lowest product price at amazon.co.jp
149
+ test_files: []