steam_scraper 1.1.10 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/lib/steam_scraper/page_retriever.rb +11 -1
- data/lib/steam_scraper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0f2b212963ade85d1d84bc30cec7e08492128ba
|
4
|
+
data.tar.gz: 9231b4f69f63765d5dc5bcba571d07cd3fb335d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14f9f369bb3a6dd24932c9a7c7268e1b11f0db5116385b053c8a5bd75b9c275dbb5fa519702d165e0b0e7075d36583fb01dfd11feef7031b911c10f6610cb615
|
7
|
+
data.tar.gz: 28a90dd8b523db345917d7177a3142b1e2919c50b654a5b52f5141cb594aeae0d8dbf605c28231d5f30016afe6b2bf1d80ba0eb6c52dbce9b682fc3d31101f3c
|
data/.rubocop.yml
CHANGED
@@ -4,9 +4,19 @@ require 'nokogiri'
|
|
4
4
|
|
5
5
|
# Class for retrieving a Nokogiri tree from a URL
|
6
6
|
class PageRetriever
|
7
|
+
def get_age_check_url(url)
|
8
|
+
url.sub('/app/', '/agecheck/app/')
|
9
|
+
end
|
10
|
+
|
7
11
|
def retrieve(url)
|
8
12
|
page_contents = HTTParty.get(url)
|
9
|
-
Nokogiri::HTML(page_contents)
|
13
|
+
page = Nokogiri::HTML(page_contents)
|
14
|
+
if page.xpath('//form[@id="agecheck_form"]')
|
15
|
+
url = get_age_check_url(url)
|
16
|
+
page_contents = HTTParty.post(url, body: { ageDay: 1, ageMonth: 1, ageYear: 1980 })
|
17
|
+
page = Nokogiri::HTML(page_contents)
|
18
|
+
end
|
19
|
+
page
|
10
20
|
rescue
|
11
21
|
nil
|
12
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steam_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Gardner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|