docapurl 0.1.0 → 0.1.1
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/CH_README.md +72 -0
- data/Gemfile.lock +3 -3
- data/README.md +46 -4
- data/docapurl.gemspec +1 -1
- data/lib/docapurl.rb +0 -4
- data/lib/docapurl/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a37e93ff0416e27430f0f1ac9bbd38e80a7daa206d72812066ccf6be85fa9f06
|
4
|
+
data.tar.gz: 1480714897707b03fb8f15cbc4f163d2610427ec6d1e03db9f153f31074dd96d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190bbab4d71c972c0c64ce41f58b77a4beda7ee6edef06b7c66fee2313b194915dd3a026f9707113b5028f4cb16515dd1790eb150501596fade9226bcbec932e
|
7
|
+
data.tar.gz: 7fccf20f97768c25ed441f48f8312422aa8dd8639300443b86ec3b46c570e261cae051281f2e5a5f1748f82881314c96d17beb72776c296f8002cdbd24548f5c
|
data/CH_README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# Docapurl
|
2
|
+
一个ruby的命令行截图网页的工具
|
3
|
+
|
4
|
+
## 安装
|
5
|
+
|
6
|
+
gem install docapurl
|
7
|
+
|
8
|
+
## 前置条件
|
9
|
+
|
10
|
+
- ruby 环境
|
11
|
+
- chrome
|
12
|
+
|
13
|
+
需要安装chrome 浏览器, 并推荐把chrome的path 加入到环境变量PATH 或者 BROWSER_PATH 中
|
14
|
+
|
15
|
+
## 使用方式
|
16
|
+
|
17
|
+
on terminal
|
18
|
+
|
19
|
+
`docapurl cap [url] [image_path]`
|
20
|
+
|
21
|
+
使用 `docapurl help cap` 获得更多帮助
|
22
|
+
|
23
|
+
## Example
|
24
|
+
|
25
|
+
```
|
26
|
+
docapurl cap https:/www.bilibili.com 1.jpg --pagedown-to-bottom
|
27
|
+
```
|
28
|
+
|
29
|
+
## FAQ
|
30
|
+
|
31
|
+
- 为啥docapurl 需要 chrome 以及在哪下载chrome?
|
32
|
+
|
33
|
+
因为 docapurl 封装了 ferrum gem 的一些截图功能, 而 ferrum 依赖于 headless Chrome .
|
34
|
+
linux 的chrome 一般都不太靠谱, 所以在这里下载官方的 https://www.chromium.org/getting-involved/download-chromium
|
35
|
+
|
36
|
+
windows 和mac 用户, 则可以在这里下载 https://www.google.com/chrome/.
|
37
|
+
|
38
|
+
下载安装完毕 chrome 后, 强烈建议将浏览器path 加入到 path 变量中
|
39
|
+
|
40
|
+
- 我能否跳过加入浏览器path 到 env PATH 中呢?
|
41
|
+
|
42
|
+
可以, 只不过在使用截图时, 需要指定浏览器path `--browser-path=you-path/to/chrome`
|
43
|
+
|
44
|
+
|
45
|
+
- 能否在 EC2 或者 ECS 上用?
|
46
|
+
|
47
|
+
可以, 只不过你要在机器中先装好 Chrome
|
48
|
+
|
49
|
+
特别提示, AWS ec2 上没中文字体, 需要安装中文字体如果你截图到是中文网页的话.
|
50
|
+
|
51
|
+
|
52
|
+
- 为啥截图网页的时候 网页底部有些图片没有出来?
|
53
|
+
|
54
|
+
因为这个网页可能使用了懒加载图片的技术, 需要图片在浏览器视区内才进行加载, cap 默认 5次 pageDown 如果你想确保都加载, 请使用 --pagedown-to-bottom 参数
|
55
|
+
|
56
|
+
## Development
|
57
|
+
|
58
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
59
|
+
|
60
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/docapurl. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
69
|
+
|
70
|
+
## Code of Conduct
|
71
|
+
|
72
|
+
Everyone interacting in the Docapurl project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/docapurl/blob/master/CODE_OF_CONDUCT.md).
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
docapurl (0.1.
|
4
|
+
docapurl (0.1.1)
|
5
5
|
ferrum (~> 0.11)
|
6
6
|
thor (~> 0.20)
|
7
7
|
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
concurrent-ruby (~> 1.1)
|
20
20
|
websocket-driver (>= 0.6, < 0.8)
|
21
21
|
public_suffix (4.0.6)
|
22
|
-
rake (
|
22
|
+
rake (13.0.3)
|
23
23
|
rspec (3.10.0)
|
24
24
|
rspec-core (~> 3.10.0)
|
25
25
|
rspec-expectations (~> 3.10.0)
|
@@ -44,7 +44,7 @@ PLATFORMS
|
|
44
44
|
DEPENDENCIES
|
45
45
|
bundler (~> 2.0)
|
46
46
|
docapurl!
|
47
|
-
rake (
|
47
|
+
rake (>= 12.3.3)
|
48
48
|
rspec (~> 3.0)
|
49
49
|
|
50
50
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# Docapurl
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
A tool to screenshot the webpage on terminal.
|
6
4
|
|
5
|
+
[chinese_readme 中文说明](https://github.com/jicheng1014/docapurl/blob/master/CH_README.md)
|
7
6
|
## Installation
|
8
7
|
|
9
8
|
Add this line to your application's Gemfile:
|
@@ -19,10 +18,53 @@ And then execute:
|
|
19
18
|
Or install it yourself as:
|
20
19
|
|
21
20
|
$ gem install docapurl
|
21
|
+
## Prerequisites
|
22
|
+
|
23
|
+
Chrome browser is required.
|
24
|
+
By the default, docapurl will invoke chrome in `PATH` ENV or ENV `BROWSER_PATH`
|
22
25
|
|
23
26
|
## Usage
|
24
27
|
|
25
|
-
|
28
|
+
on terminal
|
29
|
+
|
30
|
+
`docapurl cap [url] [image_path]`
|
31
|
+
|
32
|
+
use `docapurl help cap` to know more details
|
33
|
+
|
34
|
+
## Example
|
35
|
+
|
36
|
+
```
|
37
|
+
docapurl cap https:/www.bilibili.com 1.jpg --pagedown-to-bottom
|
38
|
+
```
|
39
|
+
|
40
|
+
## FAQ
|
41
|
+
|
42
|
+
- Why docapurl needs chrome and where to download Chrome?
|
43
|
+
|
44
|
+
Because docapurl just encapsulates functions from ferrum gem, and ferrum depends on headless Chrome.
|
45
|
+
There's no official Chrome or Chromium package for Linux don't install it this way because it's either outdated or unofficial, both are bad. Download it from official https://www.chromium.org/getting-involved/download-chromium
|
46
|
+
|
47
|
+
For mac and windows, u can download Chrome from https://www.google.com/chrome/.
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
- Could i skip adding browser path to ENV path?
|
52
|
+
|
53
|
+
Yes, use param `--browser-path=you-path/to/chrome`
|
54
|
+
|
55
|
+
|
56
|
+
- Could use it on aws EC2 or aliyun ECS servers?
|
57
|
+
|
58
|
+
Yes, but u should installed chrome on serverw first.
|
59
|
+
|
60
|
+
|
61
|
+
- Why some images in the page didn't show in the screenshot?
|
62
|
+
|
63
|
+
Because the website may use lazy loading technology to the images, the images loaded when the images in browser viewscreen.
|
64
|
+
docapurl invokes keyborard PageDown 5 times default. use param `--pagedown-to-bottom` could ensure all images load happen.
|
65
|
+
|
66
|
+
|
67
|
+
|
26
68
|
|
27
69
|
## Development
|
28
70
|
|
data/docapurl.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
31
|
spec.add_development_dependency "bundler", "~> 2.0"
|
32
|
-
spec.add_development_dependency "rake", "
|
32
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
34
34
|
spec.add_dependency 'ferrum', '~>0.11'
|
35
35
|
spec.add_dependency "thor", "~> 0.20"
|
data/lib/docapurl.rb
CHANGED
data/lib/docapurl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docapurl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- atpking
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 12.3.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 12.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
93
|
- ".travis.yml"
|
94
|
+
- CH_README.md
|
94
95
|
- CODE_OF_CONDUCT.md
|
95
96
|
- Gemfile
|
96
97
|
- Gemfile.lock
|