share_counter 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/share_counter/version.rb +1 -1
- data/lib/share_counter.rb +13 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf6bb8670d21adebb8ef85a4e0af6846687a6a7d
|
4
|
+
data.tar.gz: 665e96f318fea7838a538207120ed73df0a15c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c39b4f752ab0ce825970c23f99774d622cd1d88d19b2ff3e3e83e21a75b7f48dffda596f9911185ab20e58748c9e73dbf82d5663862dcfd8bd4cb79f62fc27
|
7
|
+
data.tar.gz: 44a54f1942757a795cbb28b2f0be12ebacb111d8809715d6493cf3b18268de3176a92adc1e9b205157ce0e48b0a11a4ec1ffdb0f35a80d871a26b28bd4ecdcc9
|
data/lib/share_counter.rb
CHANGED
@@ -43,9 +43,21 @@ module ShareCounter
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.seomoz url, access_id, secret
|
46
|
+
mozrank = 0
|
47
|
+
page_authority = 0
|
48
|
+
domain_authority = 0
|
49
|
+
|
46
50
|
client = Linkscape::Client.new(accessID: access_id, secret: secret)
|
47
51
|
response = client.urlMetrics(url, cols: :all)
|
48
|
-
|
52
|
+
|
53
|
+
if response.response.code.to_i == 200
|
54
|
+
mozrank = response.data['source'][:mozrank]
|
55
|
+
page_authority = response.data['source'][:page_authority]
|
56
|
+
domain_authority = response.data['source'][:domain_authority]
|
57
|
+
return { mozrank: mozrank, page_authority: page_authority, domain_authority: domain_authority }
|
58
|
+
end
|
59
|
+
|
60
|
+
return { mozrank: mozrank, page_authority: page_authority, domain_authority: domain_authority }
|
49
61
|
end
|
50
62
|
|
51
63
|
def self.supported_networks
|