gbbib 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/gbbib/scrapper.rb +5 -6
- data/lib/gbbib/t_scrapper.rb +5 -5
- data/lib/gbbib/version.rb +1 -1
- data/lib/relaton/processor.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18b85e35f313100356d7f8afcc53cf27cd49c5e255b9e89456dd91f1d413f932
|
4
|
+
data.tar.gz: 64603146155ab214747fe59aa4dce48eca374611a298878ffd9cd31eee6bf67b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a5d9f1cadb9623e82d7b61564fe1909e9b38f3873580bccc59b6808f284eb94ef5dd59faac3f051654261bbf906a44d0e81d3c36aac017a83709e562f90b93b
|
7
|
+
data.tar.gz: 7a674cf192020d60a91a32e68d92e65ac1daebb8ba7d67aec66552da9ce5937433316e5f64c515457985b62710fc5d3a1946dd2b6f74573bc34f6d3693fbea23
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gbbib (0.1
|
4
|
+
gbbib (0.2.1)
|
5
5
|
cnccs (~> 0.1.1)
|
6
6
|
iso-bib-item (~> 0.2)
|
7
7
|
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
docile (1.3.1)
|
16
16
|
equivalent-xml (0.6.0)
|
17
17
|
nokogiri (>= 1.4.3)
|
18
|
-
iso-bib-item (0.2.
|
18
|
+
iso-bib-item (0.2.2)
|
19
19
|
isoics (~> 0.1.6)
|
20
20
|
nokogiri (~> 1.8.4)
|
21
21
|
ruby_deep_clone (~> 0.8.0)
|
data/lib/gbbib/scrapper.rb
CHANGED
@@ -54,12 +54,11 @@ module Gbbib
|
|
54
54
|
# * :language [String]
|
55
55
|
# * :script [String]
|
56
56
|
def get_titles(doc)
|
57
|
-
titles = [{
|
58
|
-
|
59
|
-
|
60
|
-
unless
|
61
|
-
titles << { title_intro:
|
62
|
-
script: 'Latn' }
|
57
|
+
titles = [{ title_main: doc.css('div.page-header h4').text, title_intro: nil,
|
58
|
+
language: 'zh', script: 'Hans' }]
|
59
|
+
title_main = doc.css('div.page-header h5').text
|
60
|
+
unless title_main.empty?
|
61
|
+
titles << { title_main: title_main, title_intro: nil, language: 'en', script: 'Latn' }
|
63
62
|
end
|
64
63
|
titles
|
65
64
|
end
|
data/lib/gbbib/t_scrapper.rb
CHANGED
@@ -75,12 +75,12 @@ module Gbbib
|
|
75
75
|
|
76
76
|
def get_titles(doc)
|
77
77
|
xpath = '//td[contains(.,"中文标题")]/following-sibling::td[1]'
|
78
|
-
titles = [{
|
79
|
-
|
78
|
+
titles = [{ title_main: doc.xpath(xpath).text,
|
79
|
+
title_intro: nil, language: 'zh', script: 'Hans' }]
|
80
80
|
xpath = '//td[contains(.,"英文标题")]/following-sibling::td[1]'
|
81
|
-
|
82
|
-
unless
|
83
|
-
titles << {
|
81
|
+
title_main = doc.xpath(xpath).text
|
82
|
+
unless title_main.empty?
|
83
|
+
titles << { title_main: title_main, title_intro: nil, language: 'en',
|
84
84
|
script: 'Latn' }
|
85
85
|
end
|
86
86
|
titles
|
data/lib/gbbib/version.rb
CHANGED
data/lib/relaton/processor.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gbbib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|