metamatter 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +77 -0
- data/README.md +3 -0
- data/fixtures/vcr_cassettes/authors.yml +185 -59
- data/lib/metamatter/authors.rb +49 -1
- data/lib/metamatter/version.rb +1 -1
- data/spec/metamatter_authors_spec.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4090621b3137bcbdf50f08b5d39bdcaa3114c5f
|
4
|
+
data.tar.gz: 0a6f72f4631b3ca4d34720082964ab45f460cd93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4dbae9e48352102f248cbda61b014cb851eddea7e5de675a1c20478325c62ff3c13cb6579f33c1a5df54bdec78c29ebdcbd63b23866252793bf5a31333bdb06
|
7
|
+
data.tar.gz: eced531801c1eceabbb6730e3a13e6551940e558cf40e5d5408fbb85b0341e539afd9576fa978380216c2f928c5ac50bf97d1c1f92e790c9b60d78d13d958281
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
metamatter (0.1.0)
|
5
|
+
algorithmia (~> 0.2.0)
|
6
|
+
httparty (~> 0.13)
|
7
|
+
octokit (~> 4.0)
|
8
|
+
thor (~> 0.19)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
addressable (2.4.0)
|
14
|
+
algorithmia (0.2.0)
|
15
|
+
httparty (~> 0.13.1)
|
16
|
+
json (~> 1.8)
|
17
|
+
rake (~> 10.4)
|
18
|
+
coderay (1.1.1)
|
19
|
+
crack (0.4.3)
|
20
|
+
safe_yaml (~> 1.0.0)
|
21
|
+
diff-lcs (1.2.5)
|
22
|
+
faraday (0.9.2)
|
23
|
+
multipart-post (>= 1.2, < 3)
|
24
|
+
hashdiff (0.3.0)
|
25
|
+
httparty (0.13.7)
|
26
|
+
json (~> 1.8)
|
27
|
+
multi_xml (>= 0.5.2)
|
28
|
+
json (1.8.3)
|
29
|
+
method_source (0.8.2)
|
30
|
+
multi_xml (0.5.5)
|
31
|
+
multipart-post (2.0.0)
|
32
|
+
octokit (4.3.0)
|
33
|
+
sawyer (~> 0.7.0, >= 0.5.3)
|
34
|
+
pry (0.10.3)
|
35
|
+
coderay (~> 1.1.0)
|
36
|
+
method_source (~> 0.8.1)
|
37
|
+
slop (~> 3.4)
|
38
|
+
rake (10.5.0)
|
39
|
+
rspec (3.4.0)
|
40
|
+
rspec-core (~> 3.4.0)
|
41
|
+
rspec-expectations (~> 3.4.0)
|
42
|
+
rspec-mocks (~> 3.4.0)
|
43
|
+
rspec-core (3.4.4)
|
44
|
+
rspec-support (~> 3.4.0)
|
45
|
+
rspec-expectations (3.4.0)
|
46
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
+
rspec-support (~> 3.4.0)
|
48
|
+
rspec-mocks (3.4.1)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.4.0)
|
51
|
+
rspec-support (3.4.1)
|
52
|
+
safe_yaml (1.0.4)
|
53
|
+
sawyer (0.7.0)
|
54
|
+
addressable (>= 2.3.5, < 2.5)
|
55
|
+
faraday (~> 0.8, < 0.10)
|
56
|
+
slop (3.6.0)
|
57
|
+
thor (0.19.1)
|
58
|
+
vcr (2.9.3)
|
59
|
+
webmock (1.24.6)
|
60
|
+
addressable (>= 2.3.6)
|
61
|
+
crack (>= 0.3.2)
|
62
|
+
hashdiff
|
63
|
+
|
64
|
+
PLATFORMS
|
65
|
+
ruby
|
66
|
+
|
67
|
+
DEPENDENCIES
|
68
|
+
bundler (~> 1.6)
|
69
|
+
metamatter!
|
70
|
+
pry (~> 0.10)
|
71
|
+
rake (~> 10.0)
|
72
|
+
rspec (~> 3.3)
|
73
|
+
vcr (~> 2.9)
|
74
|
+
webmock (~> 1.21)
|
75
|
+
|
76
|
+
BUNDLED WITH
|
77
|
+
1.10.6
|
data/README.md
CHANGED
@@ -36,6 +36,8 @@ repository.extract #=> '{"authors": [{"name": "Arfon Smith", "email":"arfon.s
|
|
36
36
|
|
37
37
|
```
|
38
38
|
|
39
|
+
or from the command line:
|
40
|
+
|
39
41
|
```bash
|
40
42
|
GITHUB_TOKEN=your_github_token ALGORITHMIA_TOKEN=your_algorithmia_token\
|
41
43
|
metamatter extract arfon/metamatter
|
@@ -50,6 +52,7 @@ metamatter extract arfon/metamatter
|
|
50
52
|
"authors": [
|
51
53
|
{
|
52
54
|
"name": "Arfon Smith",
|
55
|
+
"orcid": "0000-0002-3957-2474",
|
53
56
|
"email": "arfon.smith@gmail.com",
|
54
57
|
"login": "arfon",
|
55
58
|
"contributions": 10
|
@@ -10,11 +10,9 @@ http_interactions:
|
|
10
10
|
Accept:
|
11
11
|
- application/vnd.github.drax-preview+json
|
12
12
|
User-Agent:
|
13
|
-
- Octokit Ruby Gem 4.0
|
13
|
+
- Octokit Ruby Gem 4.3.0
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
|
-
Authorization:
|
17
|
-
- token <GITHUB_TOKEN>
|
18
16
|
Accept-Encoding:
|
19
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
18
|
response:
|
@@ -25,7 +23,7 @@ http_interactions:
|
|
25
23
|
Server:
|
26
24
|
- GitHub.com
|
27
25
|
Date:
|
28
|
-
-
|
26
|
+
- Fri, 29 Apr 2016 22:12:40 GMT
|
29
27
|
Content-Type:
|
30
28
|
- application/json; charset=utf-8
|
31
29
|
Transfer-Encoding:
|
@@ -33,52 +31,153 @@ http_interactions:
|
|
33
31
|
Status:
|
34
32
|
- 200 OK
|
35
33
|
X-Ratelimit-Limit:
|
36
|
-
- '
|
34
|
+
- '60'
|
37
35
|
X-Ratelimit-Remaining:
|
38
|
-
- '
|
36
|
+
- '51'
|
39
37
|
X-Ratelimit-Reset:
|
40
|
-
- '
|
38
|
+
- '1461971081'
|
41
39
|
Cache-Control:
|
42
|
-
-
|
43
|
-
Last-Modified:
|
44
|
-
- Fri, 10 Jul 2015 15:23:18 GMT
|
45
|
-
Etag:
|
46
|
-
- W/"72d827407d14f75a1efb778b2078342d"
|
47
|
-
X-Oauth-Scopes:
|
48
|
-
- public_repo, user
|
49
|
-
X-Accepted-Oauth-Scopes:
|
50
|
-
- ''
|
40
|
+
- public, max-age=60, s-maxage=60
|
51
41
|
Vary:
|
52
|
-
- Accept
|
42
|
+
- Accept
|
53
43
|
- Accept-Encoding
|
44
|
+
Etag:
|
45
|
+
- W/"707c12d6c9dc7e8cad99519737403897"
|
46
|
+
Last-Modified:
|
47
|
+
- Sun, 17 Apr 2016 23:49:58 GMT
|
54
48
|
X-Github-Media-Type:
|
55
49
|
- github.drax-preview; format=json
|
56
|
-
|
57
|
-
-
|
58
|
-
|
59
|
-
-
|
50
|
+
Access-Control-Expose-Headers:
|
51
|
+
- ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
|
52
|
+
X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
|
53
|
+
Access-Control-Allow-Origin:
|
54
|
+
- "*"
|
60
55
|
Content-Security-Policy:
|
61
56
|
- default-src 'none'
|
62
|
-
|
63
|
-
-
|
57
|
+
Strict-Transport-Security:
|
58
|
+
- max-age=31536000; includeSubdomains; preload
|
59
|
+
X-Content-Type-Options:
|
60
|
+
- nosniff
|
61
|
+
X-Frame-Options:
|
62
|
+
- deny
|
63
|
+
X-Xss-Protection:
|
64
|
+
- 1; mode=block
|
65
|
+
X-Served-By:
|
66
|
+
- 8dd185e423974a7e13abbbe6e060031e
|
67
|
+
X-Github-Request-Id:
|
68
|
+
- D8A95B64:76D1:AB5972B:5723DC58
|
69
|
+
body:
|
70
|
+
encoding: ASCII-8BIT
|
71
|
+
string: '[{"login":"arfon","id":4483,"avatar_url":"https://avatars.githubusercontent.com/u/4483?v=3","gravatar_id":"","url":"https://api.github.com/users/arfon","html_url":"https://github.com/arfon","followers_url":"https://api.github.com/users/arfon/followers","following_url":"https://api.github.com/users/arfon/following{/other_user}","gists_url":"https://api.github.com/users/arfon/gists{/gist_id}","starred_url":"https://api.github.com/users/arfon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arfon/subscriptions","organizations_url":"https://api.github.com/users/arfon/orgs","repos_url":"https://api.github.com/users/arfon/repos","events_url":"https://api.github.com/users/arfon/events{/privacy}","received_events_url":"https://api.github.com/users/arfon/received_events","type":"User","site_admin":true,"contributions":41}]'
|
72
|
+
http_version:
|
73
|
+
recorded_at: Fri, 29 Apr 2016 22:12:40 GMT
|
74
|
+
- request:
|
75
|
+
method: get
|
76
|
+
uri: https://api.github.com/users/arfon
|
77
|
+
body:
|
78
|
+
encoding: US-ASCII
|
79
|
+
string: ''
|
80
|
+
headers:
|
81
|
+
Accept:
|
82
|
+
- application/vnd.github.drax-preview+json
|
83
|
+
User-Agent:
|
84
|
+
- Octokit Ruby Gem 4.3.0
|
85
|
+
Content-Type:
|
86
|
+
- application/json
|
87
|
+
Accept-Encoding:
|
88
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
89
|
+
response:
|
90
|
+
status:
|
91
|
+
code: 200
|
92
|
+
message: OK
|
93
|
+
headers:
|
94
|
+
Server:
|
95
|
+
- GitHub.com
|
96
|
+
Date:
|
97
|
+
- Fri, 29 Apr 2016 22:12:41 GMT
|
98
|
+
Content-Type:
|
99
|
+
- application/json; charset=utf-8
|
100
|
+
Transfer-Encoding:
|
101
|
+
- chunked
|
102
|
+
Status:
|
103
|
+
- 200 OK
|
104
|
+
X-Ratelimit-Limit:
|
105
|
+
- '60'
|
106
|
+
X-Ratelimit-Remaining:
|
107
|
+
- '50'
|
108
|
+
X-Ratelimit-Reset:
|
109
|
+
- '1461971081'
|
110
|
+
Cache-Control:
|
111
|
+
- public, max-age=60, s-maxage=60
|
112
|
+
Vary:
|
113
|
+
- Accept
|
114
|
+
- Accept-Encoding
|
115
|
+
Etag:
|
116
|
+
- W/"4499607361cd33913fc0753eda694680"
|
117
|
+
Last-Modified:
|
118
|
+
- Wed, 27 Apr 2016 00:52:36 GMT
|
119
|
+
X-Github-Media-Type:
|
120
|
+
- github.drax-preview; format=json
|
64
121
|
Access-Control-Expose-Headers:
|
65
122
|
- ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
|
66
123
|
X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
|
67
124
|
Access-Control-Allow-Origin:
|
68
125
|
- "*"
|
69
|
-
|
70
|
-
-
|
126
|
+
Content-Security-Policy:
|
127
|
+
- default-src 'none'
|
71
128
|
Strict-Transport-Security:
|
72
129
|
- max-age=31536000; includeSubdomains; preload
|
73
130
|
X-Content-Type-Options:
|
74
131
|
- nosniff
|
132
|
+
X-Frame-Options:
|
133
|
+
- deny
|
134
|
+
X-Xss-Protection:
|
135
|
+
- 1; mode=block
|
75
136
|
X-Served-By:
|
76
|
-
-
|
137
|
+
- e724c57ebb9961c772a91e2dd7421c8d
|
138
|
+
X-Github-Request-Id:
|
139
|
+
- D8A95B64:76D6:2A3A5DCF:5723DC58
|
140
|
+
body:
|
141
|
+
encoding: ASCII-8BIT
|
142
|
+
string: '{"login":"arfon","id":4483,"avatar_url":"https://avatars.githubusercontent.com/u/4483?v=3","gravatar_id":"","url":"https://api.github.com/users/arfon","html_url":"https://github.com/arfon","followers_url":"https://api.github.com/users/arfon/followers","following_url":"https://api.github.com/users/arfon/following{/other_user}","gists_url":"https://api.github.com/users/arfon/gists{/gist_id}","starred_url":"https://api.github.com/users/arfon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arfon/subscriptions","organizations_url":"https://api.github.com/users/arfon/orgs","repos_url":"https://api.github.com/users/arfon/repos","events_url":"https://api.github.com/users/arfon/events{/privacy}","received_events_url":"https://api.github.com/users/arfon/received_events","type":"User","site_admin":true,"name":"Arfon
|
143
|
+
Smith","company":"GitHub Inc.","blog":"arfon.org","location":"Chicago","email":"arfon.smith@gmail.com","hireable":null,"bio":null,"public_repos":59,"public_gists":70,"followers":286,"following":9,"created_at":"2008-04-03T11:05:32Z","updated_at":"2016-04-27T00:52:36Z"}'
|
144
|
+
http_version:
|
145
|
+
recorded_at: Fri, 29 Apr 2016 22:12:40 GMT
|
146
|
+
- request:
|
147
|
+
method: get
|
148
|
+
uri: https://orcid.org/v1.2/search/orcid-bio/?q=given-names:Arfon%20AND%20family-name:Smith&rows=50
|
149
|
+
body:
|
150
|
+
encoding: US-ASCII
|
151
|
+
string: ''
|
152
|
+
headers:
|
153
|
+
Accept:
|
154
|
+
- application/json
|
155
|
+
response:
|
156
|
+
status:
|
157
|
+
code: 200
|
158
|
+
message: OK
|
159
|
+
headers:
|
160
|
+
Server:
|
161
|
+
- nginx/1.4.6 (Ubuntu)
|
162
|
+
Content-Type:
|
163
|
+
- application/json;charset=UTF-8
|
164
|
+
Date:
|
165
|
+
- Fri, 29 Apr 2016 22:12:41 GMT
|
166
|
+
Transfer-Encoding:
|
167
|
+
- chunked
|
168
|
+
Access-Control-Allow-Origin:
|
169
|
+
- "*"
|
170
|
+
Connection:
|
171
|
+
- keep-alive
|
172
|
+
Set-Cookie:
|
173
|
+
- X-Mapping-fjhppofk=4ED6972B7B1BC023DCBBF535885EFB08; path=/
|
77
174
|
body:
|
78
175
|
encoding: UTF-8
|
79
|
-
string: '
|
176
|
+
string: '{"message-version":"1.2","orcid-profile":null,"orcid-search-results":{"orcid-search-result":[{"relevancy-score":{"value":15.52666},"orcid-profile":{"orcid":null,"orcid-id":null,"orcid-identifier":{"value":null,"uri":"http://orcid.org/0000-0002-3957-2474","path":"0000-0002-3957-2474","host":"orcid.org"},"orcid-deprecated":null,"orcid-preferences":null,"orcid-history":null,"orcid-bio":{"personal-details":{"given-names":{"value":"Arfon","visibility":"PUBLIC"},"family-name":{"value":"Smith","visibility":"PUBLIC"},"credit-name":null,"other-names":null},"biography":null,"researcher-urls":null,"contact-details":{"email":[{"value":"arfon.smith@gmail.com","primary":true,"current":true,"verified":true,"visibility":"PUBLIC","source":null,"source-client-id":null}],"address":null},"keywords":null,"external-identifiers":{"external-identifier":[{"orcid":null,"external-id-orcid":null,"external-id-common-name":{"value":"Scopus
|
177
|
+
Author ID"},"external-id-reference":{"value":"55498582500"},"external-id-url":{"value":"http://www.scopus.com/inward/authorDetails.url?authorID=55498582500&partnerID=MN8TOARS"},"external-id-source":null,"source":{"source-orcid":{"value":null,"uri":"http://orcid.org/0000-0002-5982-8983","path":"0000-0002-5982-8983","host":"orcid.org"},"source-client-id":null,"source-name":{"value":"Scopus
|
178
|
+
to ORCID"},"source-date":{"value":1461014874798}}}],"visibility":"PUBLIC"},"delegation":null,"scope":null},"orcid-activities":null,"orcid-internal":null,"type":null,"group-type":null,"client-type":null}}],"num-found":1},"error-desc":null}'
|
80
179
|
http_version:
|
81
|
-
recorded_at:
|
180
|
+
recorded_at: Fri, 29 Apr 2016 22:12:41 GMT
|
82
181
|
- request:
|
83
182
|
method: get
|
84
183
|
uri: https://api.github.com/users/arfon
|
@@ -89,11 +188,9 @@ http_interactions:
|
|
89
188
|
Accept:
|
90
189
|
- application/vnd.github.drax-preview+json
|
91
190
|
User-Agent:
|
92
|
-
- Octokit Ruby Gem 4.0
|
191
|
+
- Octokit Ruby Gem 4.3.0
|
93
192
|
Content-Type:
|
94
193
|
- application/json
|
95
|
-
Authorization:
|
96
|
-
- token <GITHUB_TOKEN>
|
97
194
|
Accept-Encoding:
|
98
195
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
99
196
|
response:
|
@@ -104,7 +201,7 @@ http_interactions:
|
|
104
201
|
Server:
|
105
202
|
- GitHub.com
|
106
203
|
Date:
|
107
|
-
-
|
204
|
+
- Fri, 29 Apr 2016 22:12:41 GMT
|
108
205
|
Content-Type:
|
109
206
|
- application/json; charset=utf-8
|
110
207
|
Transfer-Encoding:
|
@@ -112,51 +209,80 @@ http_interactions:
|
|
112
209
|
Status:
|
113
210
|
- 200 OK
|
114
211
|
X-Ratelimit-Limit:
|
115
|
-
- '
|
212
|
+
- '60'
|
116
213
|
X-Ratelimit-Remaining:
|
117
|
-
- '
|
214
|
+
- '49'
|
118
215
|
X-Ratelimit-Reset:
|
119
|
-
- '
|
216
|
+
- '1461971081'
|
120
217
|
Cache-Control:
|
121
|
-
-
|
122
|
-
Last-Modified:
|
123
|
-
- Fri, 17 Jul 2015 20:54:50 GMT
|
124
|
-
Etag:
|
125
|
-
- W/"dbce021f11e33a0f3382736c57062638"
|
126
|
-
X-Oauth-Scopes:
|
127
|
-
- public_repo, user
|
128
|
-
X-Accepted-Oauth-Scopes:
|
129
|
-
- user
|
218
|
+
- public, max-age=60, s-maxage=60
|
130
219
|
Vary:
|
131
|
-
- Accept
|
220
|
+
- Accept
|
132
221
|
- Accept-Encoding
|
222
|
+
Etag:
|
223
|
+
- W/"4499607361cd33913fc0753eda694680"
|
224
|
+
Last-Modified:
|
225
|
+
- Wed, 27 Apr 2016 00:52:36 GMT
|
133
226
|
X-Github-Media-Type:
|
134
227
|
- github.drax-preview; format=json
|
135
|
-
X-Xss-Protection:
|
136
|
-
- 1; mode=block
|
137
|
-
X-Frame-Options:
|
138
|
-
- deny
|
139
|
-
Content-Security-Policy:
|
140
|
-
- default-src 'none'
|
141
|
-
Access-Control-Allow-Credentials:
|
142
|
-
- 'true'
|
143
228
|
Access-Control-Expose-Headers:
|
144
229
|
- ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
|
145
230
|
X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
|
146
231
|
Access-Control-Allow-Origin:
|
147
232
|
- "*"
|
148
|
-
|
149
|
-
-
|
233
|
+
Content-Security-Policy:
|
234
|
+
- default-src 'none'
|
150
235
|
Strict-Transport-Security:
|
151
236
|
- max-age=31536000; includeSubdomains; preload
|
152
237
|
X-Content-Type-Options:
|
153
238
|
- nosniff
|
239
|
+
X-Frame-Options:
|
240
|
+
- deny
|
241
|
+
X-Xss-Protection:
|
242
|
+
- 1; mode=block
|
154
243
|
X-Served-By:
|
155
|
-
-
|
244
|
+
- ef96c2e493b28ffea49b891b085ed2dd
|
245
|
+
X-Github-Request-Id:
|
246
|
+
- D8A95B64:76D4:1D3E7D26:5723DC59
|
156
247
|
body:
|
157
|
-
encoding:
|
248
|
+
encoding: ASCII-8BIT
|
158
249
|
string: '{"login":"arfon","id":4483,"avatar_url":"https://avatars.githubusercontent.com/u/4483?v=3","gravatar_id":"","url":"https://api.github.com/users/arfon","html_url":"https://github.com/arfon","followers_url":"https://api.github.com/users/arfon/followers","following_url":"https://api.github.com/users/arfon/following{/other_user}","gists_url":"https://api.github.com/users/arfon/gists{/gist_id}","starred_url":"https://api.github.com/users/arfon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arfon/subscriptions","organizations_url":"https://api.github.com/users/arfon/orgs","repos_url":"https://api.github.com/users/arfon/repos","events_url":"https://api.github.com/users/arfon/events{/privacy}","received_events_url":"https://api.github.com/users/arfon/received_events","type":"User","site_admin":true,"name":"Arfon
|
159
|
-
Smith","company":"GitHub Inc.","blog":"arfon.org","location":"Chicago","email":"arfon.smith@gmail.com","hireable":
|
250
|
+
Smith","company":"GitHub Inc.","blog":"arfon.org","location":"Chicago","email":"arfon.smith@gmail.com","hireable":null,"bio":null,"public_repos":59,"public_gists":70,"followers":286,"following":9,"created_at":"2008-04-03T11:05:32Z","updated_at":"2016-04-27T00:52:36Z"}'
|
251
|
+
http_version:
|
252
|
+
recorded_at: Fri, 29 Apr 2016 22:12:41 GMT
|
253
|
+
- request:
|
254
|
+
method: get
|
255
|
+
uri: https://orcid.org/v1.2/search/orcid-bio/?q=given-names:Arfon%20AND%20family-name:Smith&rows=50
|
256
|
+
body:
|
257
|
+
encoding: US-ASCII
|
258
|
+
string: ''
|
259
|
+
headers:
|
260
|
+
Accept:
|
261
|
+
- application/json
|
262
|
+
response:
|
263
|
+
status:
|
264
|
+
code: 200
|
265
|
+
message: OK
|
266
|
+
headers:
|
267
|
+
Server:
|
268
|
+
- nginx/1.4.6 (Ubuntu)
|
269
|
+
Content-Type:
|
270
|
+
- application/json;charset=UTF-8
|
271
|
+
Date:
|
272
|
+
- Fri, 29 Apr 2016 22:12:42 GMT
|
273
|
+
Transfer-Encoding:
|
274
|
+
- chunked
|
275
|
+
Access-Control-Allow-Origin:
|
276
|
+
- "*"
|
277
|
+
Connection:
|
278
|
+
- keep-alive
|
279
|
+
Set-Cookie:
|
280
|
+
- X-Mapping-fjhppofk=DDCD68948EFB99725AB30B865FBA9B9A; path=/
|
281
|
+
body:
|
282
|
+
encoding: UTF-8
|
283
|
+
string: '{"message-version":"1.2","orcid-profile":null,"orcid-search-results":{"orcid-search-result":[{"relevancy-score":{"value":15.52666},"orcid-profile":{"orcid":null,"orcid-id":null,"orcid-identifier":{"value":null,"uri":"http://orcid.org/0000-0002-3957-2474","path":"0000-0002-3957-2474","host":"orcid.org"},"orcid-deprecated":null,"orcid-preferences":null,"orcid-history":null,"orcid-bio":{"personal-details":{"given-names":{"value":"Arfon","visibility":"PUBLIC"},"family-name":{"value":"Smith","visibility":"PUBLIC"},"credit-name":null,"other-names":null},"biography":null,"researcher-urls":null,"contact-details":{"email":[{"value":"arfon.smith@gmail.com","primary":true,"current":true,"verified":true,"visibility":"PUBLIC","source":null,"source-client-id":null}],"address":null},"keywords":null,"external-identifiers":{"external-identifier":[{"orcid":null,"external-id-orcid":null,"external-id-common-name":{"value":"Scopus
|
284
|
+
Author ID"},"external-id-reference":{"value":"55498582500"},"external-id-url":{"value":"http://www.scopus.com/inward/authorDetails.url?authorID=55498582500&partnerID=MN8TOARS"},"external-id-source":null,"source":{"source-orcid":{"value":null,"uri":"http://orcid.org/0000-0002-5982-8983","path":"0000-0002-5982-8983","host":"orcid.org"},"source-client-id":null,"source-name":{"value":"Scopus
|
285
|
+
to ORCID"},"source-date":{"value":1461014874798}}}],"visibility":"PUBLIC"},"delegation":null,"scope":null},"orcid-activities":null,"orcid-internal":null,"type":null,"group-type":null,"client-type":null}}],"num-found":1},"error-desc":null}'
|
160
286
|
http_version:
|
161
|
-
recorded_at:
|
287
|
+
recorded_at: Fri, 29 Apr 2016 22:12:42 GMT
|
162
288
|
recorded_with: VCR 2.9.3
|
data/lib/metamatter/authors.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require_relative 'helpers'
|
2
|
+
require 'httparty'
|
3
|
+
require 'json'
|
2
4
|
|
3
5
|
module Metamatter
|
4
6
|
class Authors
|
@@ -15,12 +17,58 @@ module Metamatter
|
|
15
17
|
contribs = github_response
|
16
18
|
contribs.each do |c|
|
17
19
|
user = client.user(c.login)
|
18
|
-
|
20
|
+
orcid = lookup_orcid(user.name)
|
21
|
+
|
22
|
+
authors << {:name => user.name, :orcid => orcid, :email => user.email, :login => user.login, :contributions => c.contributions}
|
19
23
|
end
|
20
24
|
|
21
25
|
return authors.sort_by { |a| a[:contributions] }.reverse
|
22
26
|
end
|
23
27
|
|
28
|
+
def lookup_orcid(name)
|
29
|
+
return "" unless name
|
30
|
+
family_name = name.split(' ').last
|
31
|
+
given_names = name.gsub(family_name, '').strip # hackety hack hack
|
32
|
+
url = orcid_search_url(given_names, family_name)
|
33
|
+
|
34
|
+
begin
|
35
|
+
response = HTTParty.get(url, :headers => { "Accept" => "application/json"}).body
|
36
|
+
rescue => e
|
37
|
+
response = {}
|
38
|
+
end
|
39
|
+
|
40
|
+
orcids = orcids_for(response)
|
41
|
+
|
42
|
+
if orcids.empty?
|
43
|
+
return nil
|
44
|
+
else
|
45
|
+
return orcids.first
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def orcid_search_url(given_names, family_name)
|
50
|
+
"https://orcid.org/v1.2/search/orcid-bio/?q=given-names%3A#{given_names}%20AND%20family-name%3A#{family_name}&rows=50"
|
51
|
+
end
|
52
|
+
|
53
|
+
def orcids_for(response)
|
54
|
+
parsed = JSON.parse(response)
|
55
|
+
return nil unless parsed["orcid-search-results"]
|
56
|
+
results = parsed["orcid-search-results"]["orcid-search-result"]
|
57
|
+
return nil if results.empty?
|
58
|
+
|
59
|
+
detected_orcids = Array(results).map do |result|
|
60
|
+
orcid = result['orcid-profile']['orcid-identifier'].fetch("path", nil)
|
61
|
+
end.compact
|
62
|
+
|
63
|
+
log_orcids(detected_orcids) if detected_orcids.size > 1
|
64
|
+
return detected_orcids
|
65
|
+
end
|
66
|
+
|
67
|
+
def log_orcids(orcids)
|
68
|
+
puts "Warning: More than one ORCID from search returned"
|
69
|
+
orcids.each { |orcid| puts orcid }
|
70
|
+
end
|
71
|
+
|
24
72
|
def github_response
|
25
73
|
@contributors_response ||= client.contributors(repository.name_with_owner)
|
26
74
|
end
|
data/lib/metamatter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metamatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arfon Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: algorithmia
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- ".gitignore"
|
162
162
|
- ".travis.yml"
|
163
163
|
- Gemfile
|
164
|
+
- Gemfile.lock
|
164
165
|
- LICENSE
|
165
166
|
- README.md
|
166
167
|
- Rakefile
|
@@ -207,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
208
|
version: '0'
|
208
209
|
requirements: []
|
209
210
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.4.5
|
211
212
|
signing_key:
|
212
213
|
specification_version: 4
|
213
214
|
summary: A RubyGem for extracting minmal metadata from a GitHub repository
|
@@ -219,4 +220,3 @@ test_files:
|
|
219
220
|
- spec/metamatter_readme_spec.rb
|
220
221
|
- spec/metamatter_spec.rb
|
221
222
|
- spec/spec_helper.rb
|
222
|
-
has_rdoc:
|