relaton-ecma 1.7.pre1 → 1.7.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_ecma/scrapper.rb +14 -14
- data/lib/relaton_ecma/version.rb +1 -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: 5826805692de35028ccf0275c7ca855e1f044f731488612f2f8c192536e8f180
|
4
|
+
data.tar.gz: 119d00f6ecf72910d45206e571f523c23f06344f3a1b045cdf77459e43908f5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb9ec25d82615885254ecc1193e24f39073274842c9a20a51bf7bbd8a3d4f43ef0cdbffb808b2b50b07cfee58fb56da3647eed31e85fb2677d71d857dad32219
|
7
|
+
data.tar.gz: b00dfc46e476ff792cdcc58df641a5e617b0feb19b0a2a73faababb0348bba565b82e24a6503f03212ef5345588e8b585dbe57bf6baa1967444b82720bbd228b
|
@@ -42,7 +42,7 @@ module RelatonEcma
|
|
42
42
|
# @return [Array<RelatonBib::TypedUri>]
|
43
43
|
def fetch_link(doc, url)
|
44
44
|
link = [RelatonBib::TypedUri.new(type: "src", content: url)]
|
45
|
-
ref = doc.at('//
|
45
|
+
ref = doc.at('//div[@class="ecma-item-content-wrapper"]/span/a')
|
46
46
|
link << RelatonBib::TypedUri.new(type: "doi", content: ref[:href]) if ref
|
47
47
|
link
|
48
48
|
end
|
@@ -50,7 +50,7 @@ module RelatonEcma
|
|
50
50
|
# @param doc [Nokogiri::HTML::Document]
|
51
51
|
# @return [Array<Hash>]
|
52
52
|
def fetch_title(doc)
|
53
|
-
doc.xpath('//
|
53
|
+
doc.xpath('//p[@class="ecma-item-short-description"]').map do |t|
|
54
54
|
{ content: t.text.strip, language: "en", script: "Latn" }
|
55
55
|
end
|
56
56
|
end
|
@@ -58,7 +58,7 @@ module RelatonEcma
|
|
58
58
|
# @param doc [Nokogiri::HTML::Document]
|
59
59
|
# @return [Array<RelatonBib::FormattedString>]
|
60
60
|
def fetch_abstract(doc)
|
61
|
-
a = doc.xpath('//
|
61
|
+
a = doc.xpath('//div[@class="ecma-item-content"]/p').map do |a|
|
62
62
|
a.text.strip.squeeze(" ").gsub /\r\n/, ""
|
63
63
|
end.join "\n"
|
64
64
|
return [] if a.empty?
|
@@ -69,8 +69,8 @@ module RelatonEcma
|
|
69
69
|
# @param doc [Nokogiri::HTML::Document]
|
70
70
|
# @return [Array<RelatonBib::BibliographicDate>]
|
71
71
|
def fetch_date(doc)
|
72
|
-
doc.xpath('//
|
73
|
-
date = d.text.
|
72
|
+
doc.xpath('//p[@class="ecma-item-edition"]').map do |d|
|
73
|
+
date = d.text.split(", ").last
|
74
74
|
RelatonBib::BibliographicDate.new type: "published", on: date
|
75
75
|
end
|
76
76
|
end
|
@@ -78,19 +78,19 @@ module RelatonEcma
|
|
78
78
|
# @param doc [Nokogiri::HTML::Document]
|
79
79
|
# @return [String]
|
80
80
|
def fetch_edition(doc)
|
81
|
-
doc.at('//
|
81
|
+
doc.at('//p[@class="ecma-item-edition"]')&.text&.match(/^\d+(?=th)/)&.to_s
|
82
82
|
end
|
83
83
|
|
84
84
|
# @param doc [Nokogiri::HTML::Document]
|
85
85
|
# @return [Array<Hash>]
|
86
|
-
def fetch_relation(doc)
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
bibitem = RelatonBib::BibliographicItem.new formattedref: fref
|
86
|
+
def fetch_relation(doc) # rubocop:disable Metrics/AbcSize
|
87
|
+
doc.xpath("//ul[@class='ecma-item-archives']/li").map do |rel|
|
88
|
+
ref, ed, on = rel.at("span").text.split ", "
|
89
|
+
fref = RelatonBib::FormattedRef.new content: ref, language: "en", script: "Latn"
|
90
|
+
date = []
|
91
|
+
date << RelatonBib::BibliographicDate.new(type: "published", on: on) if on
|
92
|
+
link = rel.xpath("span/a").map { |l| RelatonBib::TypedUri.new type: "doi", content: l[:href] }
|
93
|
+
bibitem = RelatonBib::BibliographicItem.new formattedref: fref, edition: ed.match(/^\d+/).to_s, link: link
|
94
94
|
{ type: "updates", bibitem: bibitem }
|
95
95
|
end
|
96
96
|
end
|
data/lib/relaton_ecma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ecma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debase
|