jekyll-artisync 0.7 → 0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3852b83cf7f0b161334e8dea66dc2b71800263857d2585923e02a680b2d6f9aa
4
- data.tar.gz: 7ae6fe9c091748ab992931abb108c3db1d4f246f8a43aa886e67828352c2f761
3
+ metadata.gz: 01afb17eccd2097c95f4071c0dce0074ec1156b70e455b78ec8c0c961e6aaf3e
4
+ data.tar.gz: 72720da82e6a39b40b0682f427c4d75397559cd7ecc23e802e9088675db60616
5
5
  SHA512:
6
- metadata.gz: 83e4b1e795cc438fd4383d8f414220bd47a757dbead917976594f44cf9f5cfef35c1cfba46dedab757e2cfbdea555e8e3487cfad4ddbdbc9df5be490ca8b9a03
7
- data.tar.gz: 3018a75eebccfa292ad20469877cd17c3e37a57954db6fd8eaf0957c5ef1f29297dc2e2c0e8efb96651318c104f49d96c882170d166ad05f81e21d85f2165c1f
6
+ metadata.gz: fd53ace05990ec40ebe945eebc5981cbddf8c8270417f7885297e8a827dada3a1fd8fb7c7f74dae13efa5a2a4beb0b704a795c752041df16da816e3c249bbd0e
7
+ data.tar.gz: e9df8042e29b3301787bb4247e826f0b8b6ae8d247a61e31e2a9978383b0e5f39a89d66981ea558140fe2e166f03721f19faf99757c9604d43544fae9d16899b
@@ -0,0 +1,14 @@
1
+ require_relative 'per_node_syncer'
2
+ require 'nokogiri'
3
+
4
+
5
+ class CSDNSyncer < PerNodeSyncer
6
+ def get_article_xpath
7
+ '//div[contains(@id, "content_views")]'
8
+ end
9
+
10
+ def _handle_node(node)
11
+ node.to_html
12
+ end
13
+
14
+ end
@@ -1,11 +1,13 @@
1
1
  require_relative 'zhihu_syncer'
2
2
  require_relative 'weixin_syncer'
3
3
  require_relative 'medium_syncer'
4
+ require_relative 'csdn_syncer'
4
5
 
5
6
 
6
7
  ZHIHU_ZHUANLAN = 'zhuanlan.zhihu.com'
7
8
  WEIXIN = 'mp.weixin.qq.com'
8
9
  MEDIUM = 'medium.com'
10
+ CSDN = 'blog.csdn.net'
9
11
 
10
12
  class SyncerFactory
11
13
  def self.get_syncer(uri)
@@ -18,6 +20,8 @@ class SyncerFactory
18
20
  return WeixinSyncer.new(uri)
19
21
  when MEDIUM
20
22
  return MediumSyncer.new(uri)
23
+ when CSDN
24
+ return CSDNSyncer.new(uri)
21
25
  else
22
26
  raise "Not supported website for host: #{host_name}"
23
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-artisync
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
- - Junhan
7
+ - Junhan Zhu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-03 00:00:00.000000000 Z
11
+ date: 2020-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -33,6 +33,7 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - lib/jekyll-artisync.rb
35
35
  - lib/syncers/abstract_syncer.rb
36
+ - lib/syncers/csdn_syncer.rb
36
37
  - lib/syncers/medium_syncer.rb
37
38
  - lib/syncers/per_node_syncer.rb
38
39
  - lib/syncers/syncer_factory.rb