phantom_proxy 1.2.5 → 1.2.6

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.
@@ -64,7 +64,7 @@ module PhantomJSProxy
64
64
  @dom = "Failed to load page"
65
65
  puts("TOTAL FAIL")
66
66
  end
67
- puts("Return dom")
67
+ #puts("Return dom")
68
68
  return @dom
69
69
  end
70
70
 
@@ -79,7 +79,7 @@ module PhantomJSProxy
79
79
  IO.popen(PHANTOMJS_BIN+" --cookies-file=/tmp/phantom_proxy/cookies.txt "+script+argString) {|io|
80
80
  out = io.readlines.join
81
81
  }
82
- puts("PHANTOMJS_OUT: "+out)
82
+ #puts("PHANTOMJS_OUT: "+out)
83
83
  return out
84
84
  end
85
85
  end
@@ -49,7 +49,7 @@ module PhantomJSProxy
49
49
  http.get(env['REQUEST_URI'])
50
50
  }
51
51
 
52
- env['rack.errors'].write("Response is:"+_res.body+"\n")
52
+ #env['rack.errors'].write("Response is:"+_res.body+"\n")
53
53
 
54
54
  resp = Rack::Response.new([], 200, {'Content-Type' => type}) { |r|
55
55
  r.write(_res.body)
@@ -126,6 +126,15 @@ function main() {
126
126
  console.log('start openning page');
127
127
 
128
128
  masterURL = address;
129
+
130
+ //catches status != 200 and throws error immidiatly
131
+ page.onResourceReceived = function (response) {
132
+ if (response.stage == "end" && response.url == address && response.status != 200)
133
+ {
134
+ console.log('FAILED_LOADING_URL: '+response.status);
135
+ phantom.exit();
136
+ }
137
+ };
129
138
 
130
139
  page.open(address, function (status) {
131
140
  if (status !== 'success') {
@@ -0,0 +1,3 @@
1
+ Open page: https://hp.taleo.net/careersection/2/jobdetail.ftt?lang=en&job=1&, lang=en&job=1& END
2
+ start openning page
3
+ FAILED_LOADING_URL: 404
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phantom_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-29 00:00:00.000000000 Z
12
+ date: 2012-07-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thin
@@ -58,6 +58,7 @@ files:
58
58
  - lib/phantom_proxy/scripts/proxy.js
59
59
  - lib/phantom_proxy/config.ru
60
60
  - lib/phantom_proxy/web/control_panel.html
61
+ - lib/phantom_proxy/scripts/test
61
62
  - lib/phantom_proxy/install/phproxy
62
63
  - bin/phantom_proxy
63
64
  - README.rdoc