relaton-cen 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_cen/cen_bibliography.rb +1 -10
- data/lib/relaton_cen/hit_collection.rb +9 -7
- data/lib/relaton_cen/scrapper.rb +1 -1
- data/lib/relaton_cen/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: '09727f48b755249b669732a011ca4674b4f0a1f782d9adc9bf49a2c6ea9bda42'
|
4
|
+
data.tar.gz: c6e98c93aecbd1e291e03d9967b819131299532232d3e1122ccca717c64c821b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b14a05ff7c665101f1dc9a4d469a621696a6560230a920df8f406d981a606bc6813a2af45eb039f7a37fe76ba2e4eee809508901c988b50f65e36f5166843527
|
7
|
+
data.tar.gz: fe5c8f91f64774b9aa1f5f7bf3b10ae58da09fef73d2b0a4f9cea6aa472116f8514d74950b7cd7f516f1b3c72ac435ab2e46c729fb919a32f824cbcb1683b806
|
@@ -26,20 +26,11 @@ module RelatonCen
|
|
26
26
|
# reference is required
|
27
27
|
# @return [RelatonBib::BibliographicItem, nil]
|
28
28
|
def get(code, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
29
|
-
# if year.nil?
|
30
29
|
code1, year1 = code.split ":"
|
31
|
-
# unless code1.nil?
|
32
30
|
code = code1
|
33
31
|
year ||= year1
|
34
|
-
# end
|
35
|
-
# end
|
36
|
-
|
37
|
-
ret = bib_get1(code, year, opts)
|
38
|
-
return nil if ret.nil?
|
39
32
|
|
40
|
-
|
41
|
-
# ret = ret.to_all_parts if opts[:all_parts]
|
42
|
-
ret
|
33
|
+
bib_get1(code, year, opts)
|
43
34
|
end
|
44
35
|
|
45
36
|
private
|
@@ -5,7 +5,7 @@ require "relaton_cen/hit"
|
|
5
5
|
module RelatonCen
|
6
6
|
# Page of hit collection.
|
7
7
|
class HitCollection < RelatonBib::HitCollection
|
8
|
-
DOMAIN = "https://standards.
|
8
|
+
DOMAIN = "https://standards.cencenelec.eu/dyn/www/"
|
9
9
|
|
10
10
|
# @return [Mechanize]
|
11
11
|
attr_reader :agent
|
@@ -21,23 +21,25 @@ module RelatonCen
|
|
21
21
|
return
|
22
22
|
end
|
23
23
|
|
24
|
-
search_page = agent.get "#{DOMAIN}f?p=
|
25
|
-
form = search_page.at "//form"
|
26
|
-
|
27
|
-
|
24
|
+
search_page = agent.get "#{DOMAIN}f?p=205:105:0:::::"
|
25
|
+
form = search_page.at "//form[@id='wwvFlowForm']"
|
26
|
+
skip_inputs = %w[f11 essentialCookies]
|
27
|
+
req_body = form.xpath(".//input").map do |f|
|
28
|
+
next if f[:name].empty? || skip_inputs.include?(f[:name])
|
28
29
|
|
29
30
|
val = case f[:value]
|
30
31
|
when "LANGUAGE_LIST" then 0
|
31
32
|
when "STAND_REF" then ref
|
32
33
|
else
|
33
34
|
case f[:name]
|
34
|
-
when "p_request" then "S1-S2-S3-S4-S5-S6"
|
35
|
+
when "p_request" then "S1-S2-S3-S4-S5-S6-CEN-CLC-"
|
35
36
|
when "f10" then ""
|
36
37
|
else f[:value]
|
37
38
|
end
|
38
39
|
end
|
39
40
|
if f[:name] == "f10" then "f10=#{f[:value]}&f11=#{val}"
|
40
|
-
else
|
41
|
+
else
|
42
|
+
"#{f[:name]}=#{val}"
|
41
43
|
end
|
42
44
|
end.compact.join("&")
|
43
45
|
resp = agent.post form[:action], req_body
|
data/lib/relaton_cen/scrapper.rb
CHANGED
@@ -76,7 +76,7 @@ module RelatonCen
|
|
76
76
|
# @return [RelatonIsoBib::EditorialGroup]
|
77
77
|
def fetch_editorialgroup(doc) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
|
78
78
|
code = doc.at("//tr/td/h1/text()").text
|
79
|
-
title = doc.at("//tr/td/h1
|
79
|
+
title = doc.at("//tr/td[3]/h1").text
|
80
80
|
%r{/(?<type>\w+)(?:\s(?<num>[^/]+))?$} =~ code
|
81
81
|
tc = []
|
82
82
|
COMMITTEES.each do |k, v|
|
data/lib/relaton_cen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-cen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.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: 2021-08
|
11
|
+
date: 2021-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|