relaton-bipm 1.13.5 → 1.13.6
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 +4 -4
- data/README.adoc +8 -0
- data/lib/relaton_bipm/bipm_bibliography.rb +14 -10
- data/lib/relaton_bipm/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: aeddd651dcb48a277d10ad9351ba46351b7fe43eb8b136a359148d83a23ca7c0
|
|
4
|
+
data.tar.gz: 5b25f339d03c0278660b58a7b190e88e5a1c05ab0bcbec007fb8fdd6108efa7d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3b913ce825a85cb4e751bb149422427f6828f009fe6324b08c18c25ab6573c0e365f266d7954940a79e63bacd8fb52ee81d37aa983749d1d0403c3fee0c1dcd1
|
|
7
|
+
data.tar.gz: 202619fe86dde21f5bfe8efb221177ab3cd078c4fcd57078b1584baf6609fed489d1c16e0d84b4fe5aa63bd88f59dd53b8b5d36c4d10931c6f57702c0b909ad0
|
data/README.adoc
CHANGED
|
@@ -33,6 +33,14 @@ Or install it yourself as:
|
|
|
33
33
|
|
|
34
34
|
=== Search for a standard using keywords
|
|
35
35
|
|
|
36
|
+
The Metrologia website employs anti-DDoS protection, which may cause the search to fail. If this happens, open provided link in a browser and solve the captcha.
|
|
37
|
+
|
|
38
|
+
----
|
|
39
|
+
[relaton-bipm] ("BIPM Metrologia 50 4 385") fetching...
|
|
40
|
+
[relaton-bipm] This source employs anti-DDoS measures that unfortunately affects automated requests.
|
|
41
|
+
[relaton-bipm] Please visit this link in your browser to resolve the CAPTCHA, then retry: https://iopscience.iop.org/article/10.1088/0026-1394/50/4/385
|
|
42
|
+
----
|
|
43
|
+
|
|
36
44
|
==== References for Si-Brochure documents
|
|
37
45
|
|
|
38
46
|
`BIPM {DOCUMENT_NAME}`
|
|
@@ -44,6 +44,7 @@ module RelatonBipm
|
|
|
44
44
|
"Upgrade-Insecure-Requests" => "1",
|
|
45
45
|
}
|
|
46
46
|
a.user_agent_alias = Mechanize::AGENT_ALIASES.map(&:first).shuffle.first
|
|
47
|
+
# a.user_agent_alias = "Mac Safari"
|
|
47
48
|
a
|
|
48
49
|
end
|
|
49
50
|
|
|
@@ -241,6 +242,7 @@ module RelatonBipm
|
|
|
241
242
|
# @param agent [Mechanize]
|
|
242
243
|
# @return [RelatonBipm::BipmBibliographicItem]
|
|
243
244
|
def get_article(path, vol, ish, agent) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
245
|
+
agent.agent.allowed_error_codes = [403]
|
|
244
246
|
rsp = agent.get path
|
|
245
247
|
check_response rsp
|
|
246
248
|
url = rsp.uri
|
|
@@ -305,15 +307,17 @@ module RelatonBipm
|
|
|
305
307
|
# @param bibtex [BibTeX::Entry]
|
|
306
308
|
# @return [Array<Hash>]
|
|
307
309
|
def btcontrib(bibtex)
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
310
|
+
contribs = [{
|
|
311
|
+
entity: { name: bibtex.publisher.to_s }, role: [{ type: "publisher" }]
|
|
312
|
+
}]
|
|
313
|
+
return contribs unless bibtex.author
|
|
314
|
+
|
|
315
|
+
bibtex.author.split(" and ").inject(contribs) do |mem, name|
|
|
316
|
+
cname = RelatonBib::LocalizedString.new name, "en", "Latn"
|
|
317
|
+
name = RelatonBib::FullName.new completename: cname
|
|
318
|
+
author = RelatonBib::Person.new name: name
|
|
319
|
+
mem << { entity: author, role: [{ type: "author" }] }
|
|
320
|
+
end
|
|
317
321
|
end
|
|
318
322
|
|
|
319
323
|
#
|
|
@@ -354,7 +358,7 @@ module RelatonBipm
|
|
|
354
358
|
warn "[relaton-bipm] Please visit this link in your browser to resolve the CAPTCHA, then retry: #{rsp.uri}"
|
|
355
359
|
# warn "[relaton-bipm] #{rsp.uri} is redirected to #{rsp.header['location']}"
|
|
356
360
|
raise RelatonBib::RequestError, "cannot access #{rsp.uri}"
|
|
357
|
-
elsif rsp.code != "200"
|
|
361
|
+
elsif rsp.code != "200" && rsp.code != "403"
|
|
358
362
|
warn "[read_bipm] can't acces #{rsp.uri} #{rsp.code}"
|
|
359
363
|
raise RelatonBib::RequestError, "cannot acces #{rsp.uri} #{rsp.code}"
|
|
360
364
|
end
|
data/lib/relaton_bipm/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-bipm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.13.
|
|
4
|
+
version: 1.13.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-09-
|
|
11
|
+
date: 2022-09-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: byebug
|