social_shares 0.2.3 → 0.2.4
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 -2
- data/lib/social_shares/mail_ru.rb +11 -12
- data/lib/social_shares/odnoklassniki.rb +11 -2
- data/lib/social_shares/version.rb +1 -1
- data/lib/social_shares/yandex.rb +10 -0
- data/lib/social_shares.rb +2 -0
- data/social_shares.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fb7315acc49822df580034d6b28e977ac736b51
|
4
|
+
data.tar.gz: c1611ab598f7cd3aa3a27a87d94270cdf4630d53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53b32f2224f66b8906feabec2952855ad9a622a04f3e10c4c41539c24d9ef89ad81a74f389ddcbb3e00d49104081533ece9fe9e21b6f555d1fa0248bff700bc8
|
7
|
+
data.tar.gz: 2911b2b3e33ccb8ea8290fe5068281b4641680df135910593f631d7c1b8d42d23431318818696fe45865b308fba648e37557ce08cbe1306397be2cf07b56565f
|
data/README.md
CHANGED
@@ -19,8 +19,9 @@ International:
|
|
19
19
|
|
20
20
|
Russian:
|
21
21
|
* [vkontakte](http://vkontakte.ru/)
|
22
|
-
* [mail.ru](http://mail.ru/)
|
22
|
+
* [mail.ru(aka moi mir)](http://my.mail.ru/)
|
23
23
|
* [odnoklassniki](http://www.odnoklassniki.ru/)
|
24
|
+
* [yandex](http://yandex.ru/) (currently on beta, most of time returns 0)
|
24
25
|
|
25
26
|
Chinese:
|
26
27
|
* [weibo](http://www.weibo.com)
|
@@ -64,7 +65,7 @@ Fetch all shares by one method (#all, #all!):
|
|
64
65
|
```ruby
|
65
66
|
# in case of exception it will return nil
|
66
67
|
:000 > SocialShares.all url
|
67
|
-
=> {:vkontakte=>nil, :facebook=>399027, :google=>28346, :twitter=>1836, :mail_ru=>37, :odnoklassniki=>1, :reddit=>2361, :linkedin=>33, :pinterest=>21011, :stumbleupon=>43035, :weibo=>12760, :buffer=>1662}
|
68
|
+
=> {:vkontakte=>nil, :facebook=>399027, :google=>28346, :twitter=>1836, :mail_ru=>37, :odnoklassniki=>1, :reddit=>2361, :linkedin=>33, :pinterest=>21011, :stumbleupon=>43035, :weibo=>12760, :buffer=>1662, :yandex=>0}
|
68
69
|
|
69
70
|
# and this will raise it
|
70
71
|
:000 > SocialShares.all! url
|
@@ -1,18 +1,17 @@
|
|
1
1
|
module SocialShares
|
2
2
|
class MailRu < Base
|
3
|
-
|
4
|
-
response['share_mm'].to_i
|
5
|
-
end
|
6
|
-
|
7
|
-
protected
|
3
|
+
URL = 'https://connect.mail.ru/share_count'
|
8
4
|
|
9
|
-
def
|
10
|
-
response = RestClient.get(
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
def shares!
|
6
|
+
response = RestClient.get(URL, {
|
7
|
+
params: {
|
8
|
+
func: 'foo',
|
9
|
+
callback: 1,
|
10
|
+
url_list: checked_url
|
11
|
+
}
|
12
|
+
})
|
13
|
+
matches = /shares":(\d+)/.match(response)
|
14
|
+
matches ? matches[-1].to_i : 0
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
@@ -1,7 +1,16 @@
|
|
1
1
|
module SocialShares
|
2
|
-
class Odnoklassniki <
|
2
|
+
class Odnoklassniki < Base
|
3
|
+
URL = 'http://ok.ru/dk'
|
4
|
+
|
3
5
|
def shares!
|
4
|
-
response
|
6
|
+
response = RestClient.get(URL, {
|
7
|
+
params: {
|
8
|
+
'st.cmd' => 'extLike',
|
9
|
+
uid: 'odklcnt0',
|
10
|
+
ref: checked_url
|
11
|
+
}
|
12
|
+
})
|
13
|
+
/'(\d+)'\)/.match(response)[-1].to_i
|
5
14
|
end
|
6
15
|
end
|
7
16
|
end
|
data/lib/social_shares.rb
CHANGED
@@ -14,6 +14,7 @@ require 'social_shares/pinterest'
|
|
14
14
|
require 'social_shares/stumbleupon'
|
15
15
|
require 'social_shares/weibo'
|
16
16
|
require 'social_shares/buffer'
|
17
|
+
require 'social_shares/yandex'
|
17
18
|
|
18
19
|
module SocialShares
|
19
20
|
class << self
|
@@ -30,6 +31,7 @@ module SocialShares
|
|
30
31
|
:stumbleupon,
|
31
32
|
:weibo,
|
32
33
|
:buffer,
|
34
|
+
:yandex,
|
33
35
|
]
|
34
36
|
|
35
37
|
def supported_networks
|
data/social_shares.gemspec
CHANGED
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.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timur Kozmenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Check how many times url was shared in social networks, e.g. share counts.
|
70
84
|
email:
|
71
85
|
- timraell@gmail.com
|
@@ -93,6 +107,7 @@ files:
|
|
93
107
|
- lib/social_shares/version.rb
|
94
108
|
- lib/social_shares/vkontakte.rb
|
95
109
|
- lib/social_shares/weibo.rb
|
110
|
+
- lib/social_shares/yandex.rb
|
96
111
|
- social_shares.gemspec
|
97
112
|
homepage: https://github.com/Timrael/social_shares
|
98
113
|
licenses:
|