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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf6bb8670d21adebb8ef85a4e0af6846687a6a7d
4
- data.tar.gz: 665e96f318fea7838a538207120ed73df0a15c8b
3
+ metadata.gz: 04474c18c53565d71ffc628ca532764d3b7cee1e
4
+ data.tar.gz: 6575a7b833c2969ea7ee233ecdf9da8cb356d209
5
5
  SHA512:
6
- metadata.gz: a2c39b4f752ab0ce825970c23f99774d622cd1d88d19b2ff3e3e83e21a75b7f48dffda596f9911185ab20e58748c9e73dbf82d5663862dcfd8bd4cb79f62fc27
7
- data.tar.gz: 44a54f1942757a795cbb28b2f0be12ebacb111d8809715d6493cf3b18268de3176a92adc1e9b205157ce0e48b0a11a4ec1ffdb0f35a80d871a26b28bd4ecdcc9
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
 
@@ -1,3 +1,3 @@
1
1
  module ShareCounter
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-27 00:00:00.000000000 Z
11
+ date: 2015-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler