social_shares 0.3.2 → 0.3.3
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/README.md +3 -0
- data/lib/social_shares/hatebu.rb +13 -0
- data/lib/social_shares/version.rb +1 -1
- data/lib/social_shares.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ef85c357efabd0a1c0e50b506ac65696186d8f8
|
|
4
|
+
data.tar.gz: 5074d394a1ae7d4a61936706e5424a5f5be0076e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19fe64d35664fba401fae204b5eee8b2f7e559b63a21052604bd53ac76c10e84a5ce44136ff5cfb5d3da19ebfdbf7f72279ea94c55042964a728ff037e659d7f
|
|
7
|
+
data.tar.gz: d5256abfdf3a0e90ec5deeac10b8e4dfcfdf4d2fbd4d09f953bdcddc22c82cff08d3ac38d3d8d4474ecdd521924de690d56ebd1d96f37d54e9113cb49a245784
|
data/README.md
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module SocialShares
|
|
2
|
+
class Hatebu < Base
|
|
3
|
+
URL = 'http://api.b.st-hatena.com/entry.count'
|
|
4
|
+
|
|
5
|
+
def shares!
|
|
6
|
+
response = get(URL, params: {
|
|
7
|
+
url: checked_url
|
|
8
|
+
})
|
|
9
|
+
# response.body.to_i returns status code instead of body converted to integer
|
|
10
|
+
response.body.empty? ? 0 : response.body.to_f.to_i
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
data/lib/social_shares.rb
CHANGED
|
@@ -15,6 +15,7 @@ require 'social_shares/pinterest'
|
|
|
15
15
|
require 'social_shares/stumbleupon'
|
|
16
16
|
require 'social_shares/weibo'
|
|
17
17
|
require 'social_shares/buffer'
|
|
18
|
+
require 'social_shares/hatebu'
|
|
18
19
|
|
|
19
20
|
module SocialShares
|
|
20
21
|
class << self
|
|
@@ -37,6 +38,7 @@ module SocialShares
|
|
|
37
38
|
:stumbleupon,
|
|
38
39
|
:weibo,
|
|
39
40
|
:buffer,
|
|
41
|
+
:hatebu,
|
|
40
42
|
]
|
|
41
43
|
|
|
42
44
|
def supported_networks
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: social_shares
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Timur Kozmenko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-05-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|
|
@@ -97,6 +97,7 @@ files:
|
|
|
97
97
|
- lib/social_shares/buffer.rb
|
|
98
98
|
- lib/social_shares/facebook.rb
|
|
99
99
|
- lib/social_shares/google.rb
|
|
100
|
+
- lib/social_shares/hatebu.rb
|
|
100
101
|
- lib/social_shares/linkedin.rb
|
|
101
102
|
- lib/social_shares/mail_ru.rb
|
|
102
103
|
- lib/social_shares/odnoklassniki.rb
|