social_shares 0.2.4 → 0.2.5
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 -1
- data/lib/social_shares/facebook.rb +3 -6
- data/lib/social_shares/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: a746652fc7359c73e9f10aca8c6dd097ff7fc7a1
|
4
|
+
data.tar.gz: 4b21b5c56dcf8f46eedc336d685092ce86847a59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb2d7b8e536dc714235a46ec871346279543fd33645144c7b4117237d8b0e5314f147c51209c1ed6c683ea0e59e4318304d91d8acba9aa052e816c9ff8b9519b
|
7
|
+
data.tar.gz: be4340ccf79e4938f1855f237657d82417e5cfa2eb864c4e42871dea74bde955c50d3c2b413f78a40037c43a2906561b4772205cd94dd7346247e5904eb11e0c
|
data/README.md
CHANGED
@@ -5,6 +5,8 @@ Social Shares
|
|
5
5
|
|
6
6
|
Social shares is intended to easily check social sharings of an url.
|
7
7
|
|
8
|
+
You can track how many times the url was shared in various social networks, such as facebook, twitter, etc. It can be useful for some kind landings with social mechanics or for tracking network activity of your content pages.
|
9
|
+
|
8
10
|
Supported networks
|
9
11
|
------
|
10
12
|
International:
|
@@ -135,4 +137,4 @@ SUPPORTED_NETWORKS = [:foo, :vkontakte, :facebook]
|
|
135
137
|
|
136
138
|
Authors
|
137
139
|
----
|
138
|
-
* [Timur Kozmenko](https://twitter.com/Timrael)
|
140
|
+
* [Timur Kozmenko](https://twitter.com/Timrael) - timraell@gmail.com
|
@@ -1,17 +1,14 @@
|
|
1
1
|
module SocialShares
|
2
2
|
class Facebook < Base
|
3
|
-
URL = '
|
3
|
+
URL = 'https://graph.facebook.com/fql'
|
4
4
|
|
5
5
|
def shares!
|
6
6
|
response = RestClient.get(URL, {
|
7
7
|
:params => {
|
8
|
-
:
|
9
|
-
:v => '1.0',
|
10
|
-
:method => 'links.getStats',
|
11
|
-
:format => 'json'
|
8
|
+
:q => "SELECT share_count FROM link_stat WHERE url='#{checked_url}'"
|
12
9
|
}
|
13
10
|
})
|
14
|
-
JSON.parse(response)[0]['share_count'] || 0
|
11
|
+
JSON.parse(response)['data'][0]['share_count'] || 0
|
15
12
|
end
|
16
13
|
end
|
17
14
|
end
|
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.5
|
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-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|