seo_params 0.0.5 → 0.0.6
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.
- data/README.md +17 -1
- data/lib/seo_params/facebook.rb +16 -4
- data/lib/seo_params/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -88,7 +88,13 @@ To fetch only likes
|
|
88
88
|
|
89
89
|
``` ruby
|
90
90
|
SeoParams.likes("github.com")
|
91
|
-
# => "
|
91
|
+
# => "83"
|
92
|
+
```
|
93
|
+
Or fetch all Facebook's parameters:
|
94
|
+
|
95
|
+
``` ruby
|
96
|
+
SeoParams::Facebook.new("github.com").all
|
97
|
+
# => {"click_count"=>47, "comment_count"=>157, "like_count"=>83, "share_count"=>348, "total_count"=>588}
|
92
98
|
```
|
93
99
|
|
94
100
|
DMOZ:
|
@@ -192,6 +198,16 @@ Checking the position of keywords in Yandex need only for RuNET, so further desc
|
|
192
198
|
[2]: http://xml.yandex.ru/settings.xml
|
193
199
|
[3]: http://api.yandex.ru/xml/doc/dg/reference/regions.xml
|
194
200
|
|
201
|
+
## Changelog
|
202
|
+
|
203
|
+
### v.0.0.6
|
204
|
+
|
205
|
+
* rewritten method of determining the number of Likes
|
206
|
+
* added method for fetching all the parameters provided by Facebook
|
207
|
+
|
208
|
+
### v.0.0.5
|
209
|
+
|
210
|
+
* added method for fetching Google +1 counts
|
195
211
|
|
196
212
|
## Contributing
|
197
213
|
|
data/lib/seo_params/facebook.rb
CHANGED
@@ -10,11 +10,23 @@ module SeoParams
|
|
10
10
|
@url = url
|
11
11
|
end
|
12
12
|
|
13
|
+
def all
|
14
|
+
api_url = "https://graph.facebook.com/fql?q=select%20click_count,%20comment_count,%20like_count,%20share_count,%20total_count%20from%20link_stat%20where%20url=%22#{@url}%22"
|
15
|
+
# response = ActiveSupport::JSON.decode(open(api_url))
|
16
|
+
response = JSON.parse(open(api_url).read)
|
17
|
+
h = Hash.new
|
18
|
+
h["click_count"] = response["data"][0]["click_count"]
|
19
|
+
h["comment_count"] = response["data"][0]["comment_count"]
|
20
|
+
h["like_count"] = response["data"][0]["like_count"]
|
21
|
+
h["share_count"] = response["data"][0]["share_count"]
|
22
|
+
h["total_count"] = response["data"][0]["total_count"]
|
23
|
+
h
|
24
|
+
end
|
25
|
+
|
13
26
|
def likes
|
14
|
-
api_url = "
|
15
|
-
response =
|
16
|
-
|
17
|
-
total_likes.text()
|
27
|
+
api_url = "https://graph.facebook.com/fql?q=select%20click_count,%20comment_count,%20like_count,%20share_count,%20total_count%20from%20link_stat%20where%20url=%22#{@url}%22"
|
28
|
+
response =JSON.parse(open(api_url).read)
|
29
|
+
response["data"][0]["like_count"]
|
18
30
|
end
|
19
31
|
|
20
32
|
end
|
data/lib/seo_params/version.rb
CHANGED
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: seo_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Alexander Podkidyshev aka none
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
type: :runtime
|