network_profile 0.1.0 → 0.2.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/network_profile/extractors/default_profile.rb +11 -4
- data/lib/network_profile/extractors/network_profile_without_extraction.rb +1 -1
- data/lib/network_profile/extractors/researchgate_profile.rb +4 -1
- data/lib/network_profile/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: 7617b43af0544fe036d6891c054523c2737976a4affd5149dff99b9ffec79d31
|
4
|
+
data.tar.gz: d33e58df2c9fb4af37e3867e421cb7fdef3a054f234a2d86fa196d9b61bed831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f9b80fc70a71c2f16487c6c4bb4e7e7d25dcd94cd723b020b18d8317c61906f730da76d0cdda1ffac01a253669dc7ade1116b05da2508eb367c691a4588636c
|
7
|
+
data.tar.gz: eaf8d8b3dbf76c8d0f5e0f9c297824ad13d01b6946e2d8f1455f7184cb78ad9230683b83d9812ae814a15391b98b3896485d17a37da7dd84877a9e921f14fe25
|
data/Gemfile.lock
CHANGED
@@ -9,9 +9,8 @@ module NetworkProfile
|
|
9
9
|
class DefaultProfile
|
10
10
|
include ActiveSupport::DescendantsTracker
|
11
11
|
|
12
|
-
cattr_accessor :mdi_icon
|
13
|
-
|
14
12
|
class << self
|
13
|
+
attr_accessor :mdi_icon
|
15
14
|
attr_accessor :headers
|
16
15
|
end
|
17
16
|
|
@@ -62,7 +61,7 @@ module NetworkProfile
|
|
62
61
|
|
63
62
|
def data
|
64
63
|
{
|
65
|
-
site_icon: mdi_icon,
|
64
|
+
site_icon: self.class.mdi_icon,
|
66
65
|
link: @link,
|
67
66
|
title: title,
|
68
67
|
text: text,
|
@@ -86,7 +85,15 @@ module NetworkProfile
|
|
86
85
|
end
|
87
86
|
|
88
87
|
def json_ld
|
89
|
-
@json_ld ||=
|
88
|
+
@json_ld ||=
|
89
|
+
begin
|
90
|
+
ld = doc.search('script[type*=ld]').first&.text
|
91
|
+
if ld
|
92
|
+
JSON.parse(ld)
|
93
|
+
else
|
94
|
+
{}
|
95
|
+
end
|
96
|
+
end
|
90
97
|
end
|
91
98
|
|
92
99
|
def rdf
|
@@ -33,7 +33,10 @@ module NetworkProfile
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def extra_data
|
36
|
-
|
36
|
+
card = doc.at(".profile-content-item .nova-c-card")
|
37
|
+
return {} unless card
|
38
|
+
|
39
|
+
items, reads, citations = card.
|
37
40
|
search(".nova-o-grid__column").
|
38
41
|
map { |col| col.search('.nova-e-text').map(&:text) }.
|
39
42
|
map(&:first).map { |i| i.gsub(',', '').to_i }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: network_profile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Wienert
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|