sist02 0.2.4 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dc122db6dade157440b21c489cde39747515f37
4
- data.tar.gz: 617e77a2512e70f6545c0726bb6165970eea1364
3
+ metadata.gz: fa935ae5cda8c094d07ce7d9b5112ddfb9462ffd
4
+ data.tar.gz: 083cc3798cbf5e3e1e918abf0c860519208f3887
5
5
  SHA512:
6
- metadata.gz: 0ee7c7d64167a056a03297e70239ae28b91269809854bf6d383cd2cbae1e2e42191af588caa41bb043551210aef359b156e5fee2d29c5d0a2efebc49711f6a8a
7
- data.tar.gz: fb3553f0e8f8e835f64aad12b1490a3280f873789d0340b3e40d5adff68f486d50655b2d23e6e677341355f1f3d65f5401994240620da9603daba8998466dae8
6
+ metadata.gz: 7bf24808e4b1f40de6658822c579d1f77626e82145786a5f757ba01dca6937d7a1f747e4169d1e44d82ef5430921489d76c85d92dc293a06b6b9bd231edf5344
7
+ data.tar.gz: f2c9ad852d05e255b765853d7cbcde99ec27ec0ae4caf856519baf0d322318a4683571001167a0c1d437665307d0798a57590fd43b16ab307606b1d1d1572b8f
data/lib/sist02/cinii.rb CHANGED
@@ -55,5 +55,22 @@ module Sist02
55
55
  end
56
56
  return result
57
57
  end
58
+
59
+ def d_paper_ref(naid)
60
+ begin
61
+ html = open("http://ci.nii.ac.jp/naid/#{naid}.json").read
62
+ json = JSON.parser.new(html)
63
+ hash = json.parse["@graph"][0]
64
+ author = hash["dc:creator"][0][0]["@value"]
65
+ title = hash["dc:title"][0]["@value"]
66
+ publisher = hash["dc:publisher"][0]["@value"]
67
+ year = hash["dc:date"].match(/\d{4}/)
68
+ result = "#{author}. #{title}. #{publisher}, #{year}, 博士論文."
69
+ rescue => e
70
+ result = e
71
+ end
72
+ return result
73
+ end
74
+
58
75
  end
59
76
  end
@@ -1,3 +1,3 @@
1
1
  module Sist02
2
- VERSION = "0.2.4"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sist02
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makoto Hiramatsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-05 00:00:00.000000000 Z
11
+ date: 2015-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,4 +82,3 @@ signing_key:
82
82
  specification_version: 4
83
83
  summary: easy way to make sist02 formed reference
84
84
  test_files: []
85
- has_rdoc: