snapcrawl 0.2.4rc1 → 0.2.4rc3
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.
- checksums.yaml +4 -4
- data/bin/snapcrawl +12 -1
- data/lib/snapcrawl/crawler.rb +4 -6
- data/lib/snapcrawl/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7215567547e93a3e376017197b66f94aa5ec92d1aa775d209241951909666e9f
|
4
|
+
data.tar.gz: c94013330e9e165c9a28665422b66d6bc83420316a1a1f2f001e6e6c0cd6dacd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ad81c6c12ae20234ac663066e5f06cbcb7ca2c79560965e3db77147bbf0736431873d9a74fc5ea39ac4206e8329e08e33d0c87535fc09f734dcee02db5ac6de
|
7
|
+
data.tar.gz: 5877c5959414dd52b92736e400fa9f9b624e4fcd77ea863804ca110e7e5123fa266967cb6a47180bb2a7daf6c4661c3507c55ec6896fc9a59c4bd9a6480ba7d7
|
data/bin/snapcrawl
CHANGED
@@ -3,5 +3,16 @@
|
|
3
3
|
require 'snapcrawl'
|
4
4
|
trap(:INT) { abort "\r\nGoodbye" }
|
5
5
|
include Snapcrawl
|
6
|
-
|
6
|
+
|
7
|
+
begin
|
8
|
+
Crawler.instance.handle ARGV
|
9
|
+
rescue MissingPhantomJS => e
|
10
|
+
message = "Cannot find phantomjs executable in the path, please install it first."
|
11
|
+
say! "\n\n!undred!#{e.class}!txtrst!\n#{message}"
|
12
|
+
exit 2
|
13
|
+
rescue => e
|
14
|
+
puts e.backtrace.reverse if ENV['DEBUG']
|
15
|
+
say! "\n\n!undred!#{e.class}!txtrst!\n#{e.message}"
|
16
|
+
exit 1
|
17
|
+
end
|
7
18
|
|
data/lib/snapcrawl/crawler.rb
CHANGED
@@ -10,6 +10,8 @@ require 'webshot'
|
|
10
10
|
module Snapcrawl
|
11
11
|
include Colsole
|
12
12
|
|
13
|
+
class MissingPhantomJS < StandardError; end
|
14
|
+
|
13
15
|
class Crawler
|
14
16
|
def self.instance
|
15
17
|
@@instance ||= self.new
|
@@ -23,14 +25,14 @@ module Snapcrawl
|
|
23
25
|
def handle(args)
|
24
26
|
@done = []
|
25
27
|
begin
|
26
|
-
execute Docopt::docopt(doc, argv: args)
|
28
|
+
execute Docopt::docopt(doc, version: VERSION, argv: args)
|
27
29
|
rescue Docopt::Exit => e
|
28
30
|
puts e.message
|
29
31
|
end
|
30
32
|
end
|
31
33
|
|
32
34
|
def execute(args)
|
33
|
-
|
35
|
+
raise MissingPhantomJS unless command_exist? "phantomjs"
|
34
36
|
crawl args['<url>'].dup, opts_from_args(args)
|
35
37
|
end
|
36
38
|
|
@@ -204,10 +206,6 @@ module Snapcrawl
|
|
204
206
|
links_array.uniq
|
205
207
|
end
|
206
208
|
|
207
|
-
def show_version
|
208
|
-
puts VERSION
|
209
|
-
end
|
210
|
-
|
211
209
|
def doc
|
212
210
|
@doc ||= File.read template 'docopt.txt'
|
213
211
|
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.4rc3
|
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: 2018-10-
|
11
|
+
date: 2018-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.1'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: phantomjs
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '2.0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '2.0'
|
83
69
|
description: Snapcrawl is a command line utility for crawling a website and saving
|
84
70
|
screenshots.
|
85
71
|
email: db@dannyben.com
|