spider_html 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62edabc1b9c11b9f82201fd7eb2c04e504533fcf
4
- data.tar.gz: 14b2c12410bc8e1c91c98a73054800e31ebf76df
3
+ metadata.gz: 0d82ac10b21627fc9f81399be1619da70f3934c3
4
+ data.tar.gz: 7e5b74677ad295f48c086862f35f1459c51737d3
5
5
  SHA512:
6
- metadata.gz: 2c5c164c7e389eb121053892cf72a646a0283a3e0438c62beddb8a78c0c759f40ce32270f9d49589d26aeeaa9a2c0607ecca4c1f4a23a3b2b55add3f2ba20e24
7
- data.tar.gz: 5b160fee78fd9084f1e0d14385f52579b8d97a481d41eb1e9c231587114dbd96f3a47ffbcc3cb7c72da2c2dac8f03d6b299b2da17567eb0f16503b5e397fe49b
6
+ metadata.gz: b94afe8983e111281ae53a9e33684f5f616ba8b1f389789c3642a415f5e4b0fcc094d7528d8bfe17b19592d45a110dafe0b34f01bc66e917402c70a09749f64d
7
+ data.tar.gz: 22d8b0e8147c4372e7c3b68ba9b9f886c788d92a4c131159bc228f43bec93979c84d18d4ff32ca1ea327403d9af29d503ae2c1daabc40bef45542de71cae7035
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spider_html (0.1.8)
4
+ spider_html (0.1.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/spider_html.rb CHANGED
@@ -5,6 +5,10 @@ require "openssl"
5
5
  require "yaml"
6
6
 
7
7
  class SpiderHtml
8
+ # SpiderHtml.request_http("https://www.baidu.com")
9
+ # SpiderHtml.request_http("https://www.baidu.com",{method: post})
10
+ # opt传入method,默认是get方法
11
+ # return {body: body, code: code}
8
12
  def self.request_http(url, opt={})
9
13
  uri = URI(url)
10
14
  if opt[:method] == "post"
@@ -18,6 +22,8 @@ class SpiderHtml
18
22
  return {body: res.body, code: res.code}
19
23
  end
20
24
 
25
+ # SpiderHtml.phantom_file("https://www.baidu.com", "baidu.html")
26
+ # SpiderHtml.phantom_file("https://www.baidu.com", "baidu.html", image_dir: "#{Dir.pwd}/image", html_dir: "#{Dir.pwd}/html")
21
27
  # 可以默认在项目里面constants/spider_html.yml
22
28
  # 可以传入image_dir,html_dir,logger
23
29
  def self.phantom_file(url, file_name, opt={})
@@ -1,3 +1,3 @@
1
1
  class SpiderHtml
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spider_html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - xiangyang
@@ -65,6 +65,7 @@ files:
65
65
  - pkg/spider_html-0.1.5.gem
66
66
  - pkg/spider_html-0.1.6.gem
67
67
  - pkg/spider_html-0.1.7.gem
68
+ - pkg/spider_html-0.1.8.gem
68
69
  - spider_html.gemspec
69
70
  homepage: ''
70
71
  licenses: