snapcrawl 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/bin/snapcrawl +4 -0
- data/lib/snapcrawl/crawler.rb +3 -0
- data/lib/snapcrawl/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9c27716eb979e1a2bc5cd75e558351303f8de5e182fae5f00b69514472127d5
|
4
|
+
data.tar.gz: d53cedc2ca9c197da0e312f42820271aa61034e648f6b0066794429eb30672d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69354ab62295ce7438982564c2fb13a928436e9771117090581b7d4035bf1afdbc2269f3a1d1df9e4805c31c53fb967932e59504f28abec9e562e765042b470c
|
7
|
+
data.tar.gz: e322dc91ced76a796de9b357d71c852c155a6e7bda4b24034d707e4f862d33bc93a490135f0ed157c072ae0f6614c804983720caba156b6a7da317fccbea9882
|
data/README.md
CHANGED
@@ -21,6 +21,12 @@ Features
|
|
21
21
|
- Reports broken links
|
22
22
|
|
23
23
|
|
24
|
+
Prerequisites
|
25
|
+
--------------------------------------------------
|
26
|
+
|
27
|
+
Snapcrawl requires [PhantomJS][1] and [ImageMagick][2].
|
28
|
+
|
29
|
+
|
24
30
|
Install
|
25
31
|
--------------------------------------------------
|
26
32
|
|
@@ -68,3 +74,9 @@ Notes
|
|
68
74
|
1. If a URL cannot be found, Snapcrawl will report to stderr.
|
69
75
|
You can create a report by running `snapcrawl go example.com 2> err.txt`
|
70
76
|
|
77
|
+
|
78
|
+
|
79
|
+
---
|
80
|
+
|
81
|
+
[1]: http://phantomjs.org/download.html
|
82
|
+
[2]: https://imagemagick.org/script/download.php
|
data/bin/snapcrawl
CHANGED
@@ -10,6 +10,10 @@ rescue MissingPhantomJS => e
|
|
10
10
|
message = "Cannot find phantomjs executable in the path, please install it first."
|
11
11
|
say! "\n\n!undred!#{e.class}!txtrst!\n#{message}"
|
12
12
|
exit 2
|
13
|
+
rescue MissingImageMagick=> e
|
14
|
+
message = "Cannot find convert (ImageMagick) executable in the path, please install it first."
|
15
|
+
say! "\n\n!undred!#{e.class}!txtrst!\n#{message}"
|
16
|
+
exit 3
|
13
17
|
rescue => e
|
14
18
|
puts e.backtrace.reverse if ENV['DEBUG']
|
15
19
|
say! "\n\n!undred!#{e.class}!txtrst!\n#{e.message}"
|
data/lib/snapcrawl/crawler.rb
CHANGED
@@ -11,6 +11,7 @@ module Snapcrawl
|
|
11
11
|
include Colsole
|
12
12
|
|
13
13
|
class MissingPhantomJS < StandardError; end
|
14
|
+
class MissingImageMagick < StandardError; end
|
14
15
|
|
15
16
|
class Crawler
|
16
17
|
def self.instance
|
@@ -33,6 +34,7 @@ module Snapcrawl
|
|
33
34
|
|
34
35
|
def execute(args)
|
35
36
|
raise MissingPhantomJS unless command_exist? "phantomjs"
|
37
|
+
raise MissingImageMagick unless command_exist? "convert"
|
36
38
|
crawl args['<url>'].dup, opts_from_args(args)
|
37
39
|
end
|
38
40
|
|
@@ -235,6 +237,7 @@ module Snapcrawl
|
|
235
237
|
$keep_stdout, $keep_stderr = $stdout, $stderr
|
236
238
|
$stdout, $stderr = StringIO.new, StringIO.new
|
237
239
|
yield
|
240
|
+
ensure
|
238
241
|
$stdout, $stderr = $keep_stdout, $keep_stderr
|
239
242
|
end
|
240
243
|
end
|
data/lib/snapcrawl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapcrawl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -99,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
|
103
|
-
rubygems_version: 2.7.6
|
102
|
+
rubygems_version: 3.0.3
|
104
103
|
signing_key:
|
105
104
|
specification_version: 4
|
106
105
|
summary: Crawl a website and take screenshots (CLI + Library)
|