glebtv-screencap 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/screencap/phantom.rb +2 -1
- data/lib/screencap/raster.js +8 -1
- data/lib/screencap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 026ee88afd7c9aa3f936b2a6f489398021dbd6c4
|
4
|
+
data.tar.gz: f3c4ef13cc5e8febc63b36012fb92397a85b68c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b5aef9947d92557faa3e415999b4fef4ad13232e1c9e0544e047901c898483760b77a510cc2a530368582eb55e48ec1edf8c57583f1af2f2366280b05baa0c
|
7
|
+
data.tar.gz: 99aa3930f4b872923ad363fd07a1f0db0d41e10b3fb469580ee50c4c1f94faa7d629657ab2ea17a8d2f0d5e8f6c284202f0997bb57c9c58791cd527b8fd1dbcd
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1.
|
1
|
+
2.1.6
|
data/lib/screencap/phantom.rb
CHANGED
@@ -10,8 +10,9 @@ module Screencap
|
|
10
10
|
#puts RASTERIZE.to_s, params
|
11
11
|
cookies = Rails.root.join("tmp", "cookies.txt")
|
12
12
|
params.push "--cookies-file=#{cookies.to_s}"
|
13
|
+
params.push "--ssl-protocol=any"
|
13
14
|
result = Phantomjs.run(RASTERIZE.to_s, *params)
|
14
|
-
#
|
15
|
+
# puts result
|
15
16
|
raise Screencap::Error, "Could not load URL #{url}" if result.match /Unable to load/
|
16
17
|
end
|
17
18
|
|
data/lib/screencap/raster.js
CHANGED
@@ -36,8 +36,15 @@ page.onConsoleMessage = function (msg) {
|
|
36
36
|
console.log("from page: " + msg);
|
37
37
|
};
|
38
38
|
|
39
|
+
page.onResourceRequested = function(requestData, networkRequest) {
|
40
|
+
if (requestData.url.match(/socket\.io/i)) {
|
41
|
+
console.log('Break polling to: %s', requestData.url);
|
42
|
+
networkRequest.abort()
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
39
46
|
page.open(args.url, function (status) {
|
40
|
-
console.log(status, args);
|
47
|
+
console.log(status, JSON.stringify(args, undefined, 4));
|
41
48
|
if(status !== 'success') {
|
42
49
|
console.log('Unable to load:' + args.url);
|
43
50
|
phantom.exit();
|
data/lib/screencap/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glebtv-screencap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-07-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.4.5
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: uses Phantom.js to grab pages, or parts of pages. Simple API.
|