share_counter 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/share_counter.rb +6 -1
- data/lib/share_counter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04474c18c53565d71ffc628ca532764d3b7cee1e
|
4
|
+
data.tar.gz: 6575a7b833c2969ea7ee233ecdf9da8cb356d209
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 595cb0b4f267d54c6da34cf6bced7f91b0736d5825e1c265c83f12599fb53d709eb7e0fba9b647dfe6df83447c1acb32aa22f010a7c9f93eb85516835226a0c5
|
7
|
+
data.tar.gz: d7e79ea7d9e841cfded4354ed77d71187da98210faa962fdf501ece5ecba71cf466206f8b0fed0b02d47e269cff9295dd4af9cfcd91f94b923defbf349559a9d
|
data/README.md
CHANGED
@@ -48,7 +48,7 @@ MozRank and PageAuthority
|
|
48
48
|
```ruby
|
49
49
|
share_counter = ShareCounter.seomoz url, 'access_id', 'secret'
|
50
50
|
|
51
|
-
{:mozrank=>5.797102554162212, :page_authority=>31.615971930077954}
|
51
|
+
{:mozrank=>5.797102554162212, :page_authority=>31.615971930077954, :domain_authority=>33.44}
|
52
52
|
```
|
53
53
|
|
54
54
|
|
data/lib/share_counter.rb
CHANGED
@@ -27,11 +27,16 @@ module ShareCounter
|
|
27
27
|
|
28
28
|
def self.linkedin url
|
29
29
|
html = make_request "https://www.linkedin.com/countserv/count/share", url: url, callback: "IN.Tags.Share.handleCount"
|
30
|
-
return JSON.parse(html)['count']
|
30
|
+
return JSON.parse(html)['count']
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.stumbleupon url
|
34
34
|
html = make_request "http://www.stumbleupon.com/services/1.01/badge.getinfo", url: url
|
35
|
+
|
36
|
+
if not JSON.parse(html)['success'] or not JSON.parse(html)['result']['views']
|
37
|
+
return 0
|
38
|
+
end
|
39
|
+
|
35
40
|
return JSON.parse(html)['result']['views']
|
36
41
|
end
|
37
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: share_counter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Davide Santangelo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|