phantom_proxy 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/phantom_proxy/phantomjs.rb +7 -2
- metadata +4 -4
@@ -52,7 +52,9 @@ module PhantomJSProxy
|
|
52
52
|
dom_text = "Failed to load page"
|
53
53
|
|
54
54
|
if /DONE_LOADING_URL/.match(@dom)
|
55
|
+
puts("LOAD_DOM_TEXT")
|
55
56
|
dom_text = getDOMText @dom
|
57
|
+
puts("LOAD_DOM_TEXT_DONE")
|
56
58
|
if pictureOnly && File.exist?(picture)
|
57
59
|
puts("File is there")
|
58
60
|
@image = IO::File.open(picture, "rb") {|f| f.read }
|
@@ -64,8 +66,9 @@ module PhantomJSProxy
|
|
64
66
|
@ready = 200
|
65
67
|
end
|
66
68
|
if /FAILED_LOADING_URL/.match(@dom)
|
69
|
+
puts("LOAD_ERROR_CODE")
|
67
70
|
@ready = getHTTPCode @dom
|
68
|
-
puts("
|
71
|
+
puts("LOAD_ERROR_CODE_DONE")
|
69
72
|
end
|
70
73
|
@dom = dom_text
|
71
74
|
return @dom
|
@@ -78,7 +81,9 @@ module PhantomJSProxy
|
|
78
81
|
end
|
79
82
|
|
80
83
|
def getHTTPCode data
|
81
|
-
tmp =
|
84
|
+
tmp = data.split('FAILED_LOADING_URL:')[1];
|
85
|
+
tmp = tmp.split('FAILED_LOADING_URL_END')[0]
|
86
|
+
#tmp = /FAILED_LOADING_URL: (.*?)FAILED_LOADING_URL_END/.match(data)[1]
|
82
87
|
tmp.to_i
|
83
88
|
end
|
84
89
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phantom_proxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 8
|
10
|
+
version: 1.2.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Sudmann
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-09-
|
18
|
+
date: 2012-09-26 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|