snapcrawl 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/snapcrawl/crawler.rb +7 -1
- data/lib/snapcrawl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83077ce26e7825a14948d6048ff92ee5cc15a17e3eeaae5687d891b68d83cd92
|
4
|
+
data.tar.gz: 15f264f683c08f9c0a2d379fa76e3dad1698a30808fb3694ccf334b45450c8ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d1a62d2c24dbf675c7e83449782ed88e7de62122082033239bc9ce436566dea5f1bad5b442784f1a476d05d75f20a52ec17c3a0fd6bd3a3a4ef7dcf7f76d07
|
7
|
+
data.tar.gz: ab17a294bad674814dd1e47407f9da58ae9c81dd1becee0db9d57d944c41ea6727cad6123b03797bd238b061b3138d9c4c42b32bd7f384a04716aeb4d93ee670
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ You can run Snapcrawl by using this docker image (which contains all the
|
|
27
27
|
necessary prerequisites):
|
28
28
|
|
29
29
|
```shell
|
30
|
-
$ alias snapcrawl=
|
30
|
+
$ alias snapcrawl='docker run --rm -it --volume $PWD:/app dannyben/snapcrawl'
|
31
31
|
```
|
32
32
|
|
33
33
|
For more information on the Docker image, refer to the [docker-snapcrawl][3] repository.
|
data/lib/snapcrawl/crawler.rb
CHANGED
@@ -67,12 +67,18 @@ module Snapcrawl
|
|
67
67
|
$logger.info "screenshot for #{page.path} already exists"
|
68
68
|
else
|
69
69
|
$logger.info "%{bold}capturing screenshot for #{page.path}%{reset}"
|
70
|
-
|
70
|
+
save_screenshot page, outfile
|
71
71
|
end
|
72
72
|
|
73
73
|
true
|
74
74
|
end
|
75
75
|
|
76
|
+
def save_screenshot(page, outfile)
|
77
|
+
page.save_screenshot outfile
|
78
|
+
rescue => e
|
79
|
+
$logger.error "screenshot error on %{purple}%{underlined}#{page.path}%{reset} - %{red}#{e.class}%{reset}: #{e.message}"
|
80
|
+
end
|
81
|
+
|
76
82
|
def file_fresh?(file)
|
77
83
|
Config.cache_life > 0 and File.exist?(file) and file_age(file) < Config.cache_life
|
78
84
|
end
|
data/lib/snapcrawl/version.rb
CHANGED