PageRankr 4.3.0 → 4.4.0

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: a751693de7ef745eadf6c65ceb139529d14bec76
4
- data.tar.gz: 83ee90cc7f4fde99e3a9e0ec70052d566511ae1a
3
+ metadata.gz: 37be70bdd1169c223bf1941e96da9b0b34938f23
4
+ data.tar.gz: 6489b9c218baafbcd445d73c8efddd7171a0682c
5
5
  SHA512:
6
- metadata.gz: 7556bbb5e766b538663dfc9f64bec471336f0c2c33f2387d4598862c09869e35ab43a58341513f3ab6b1a0374cfdbed4cad8eedc195fc0762caec54ac552d760
7
- data.tar.gz: badec38a9ad5299d8a15a3c99bb8082f3c50c83549d2d5009d9e968c4ed4e3e882bfb36365e2933b32a92dff00b505a948943bad025bd8ab82576be9c7076ad2
6
+ metadata.gz: c582233293814d0018ba4f5181a3d3b9f8474a0ab487761126e1835678f86bee97da8012512dd0a6ec6a62eb952355e8817998531ba69a21edb42829d8b9afcf
7
+ data.tar.gz: 0d685e441a47467f6d06cf7baf4925b647f56a0b01885b545907e686a9621f89e2e98b6bb5e1aa763ff1fb498984a83a2e9c1d515c46c630752ee7ba882f038f
@@ -1 +1 @@
1
- 2.0.0
1
+ 2.1.3
@@ -1,3 +1,4 @@
1
1
  rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
+ - 2.1.5
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 4.4.0
4
+ * Adds social signals for google, linked_in, pinterest, stumble_upon, twitter, and vk
5
+
3
6
  ## Version 4.3.0
4
7
  * Add Page Authority and Domain Authority ranks
5
8
 
@@ -8,15 +8,15 @@ Gem::Specification.new do |s|
8
8
  s.email = ["blatyo@gmail.com"]
9
9
  s.license = 'MIT'
10
10
  s.homepage = "http://github.com/blatyo/page_rankr"
11
- s.summary = "Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, and index counts."
12
- s.description = "Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, and index counts."
11
+ s.summary = "Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, index counts and different types of social signals"
12
+ s.description = "Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, index counts and different types of social signals"
13
13
 
14
14
  s.required_rubygems_version = ">= 1.3.6"
15
15
  s.add_development_dependency "rake"
16
16
  s.add_development_dependency "rspec", ">= 2.6.0"
17
17
  s.add_development_dependency "bundler", ">= 1.0.0"
18
18
  s.add_development_dependency "fuubar", ">= 0.0.1"
19
- s.add_development_dependency "vcr"
19
+ s.add_development_dependency "vcr", ">= 2.9.3"
20
20
  s.add_development_dependency "fakeweb"
21
21
 
22
22
  s.add_runtime_dependency "nokogiri", ">= 1.4.1"
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PageRankr [![Build Status](https://api.travis-ci.org/blatyo/page_rankr.png)](http://travis-ci.org/blatyo/page_rankr)
2
2
 
3
- Provides an easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, and index counts.
3
+ Provides an easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, index counts and different types of social signals.
4
4
 
5
5
  I'm looking for co-maintainers. If you'd like to help maintain this project, let me know.
6
6
 
@@ -120,6 +120,32 @@ Valid rank trackers are: `:alexa_country, :alexa_global, :alexa_us, :google, :mo
120
120
 
121
121
  Alexa ranks are descending where 1 is the most popular. Google page ranks are in the range 0-10 where 10 is the most popular. If a site is unindexed then the rank will be nil.
122
122
 
123
+ ### Socials
124
+
125
+ Social signals are a somewhat oversimplified way of telling how popular a site or page currently is.
126
+
127
+ ``` ruby
128
+ PageRankr.socials('www.google.com', :linked_in) #=> {:linked_in=>1001}
129
+ ```
130
+
131
+ If you don't specify a social tracker, then all of them are used.
132
+
133
+ ``` ruby
134
+ PageRankr.socials('www.google.com', :google, :linked_in, :pinterest, :stumbled_upon, :twitter, :vk)
135
+ #=> {:google=>10000, :linked_in=>1001, :pinterest=>75108, :stumple_upon=>255078, :twitter=>21933764, :vk=>3725}
136
+
137
+ # this also gives the same result
138
+ PageRankr.socials('www.google.com')
139
+ #=> {:google=>10000, :linked_in=>1001, :pinterest=>75108, :stumble_upon=>255078, :twitter=>21933764, :vk=>3725}
140
+ ```
141
+
142
+ Valid social trackers are: `:google, :linked_in, :pinterest, :stumble_upon, :twitter, :vk`. To get this you can do:
143
+
144
+ ``` ruby
145
+ PageRankr.social_trackers #=> [:google, :linked_in, :pinterest, :stumble_upon, :twitter, :vk]
146
+ ```
147
+
148
+
123
149
  ## Use it a la carte!
124
150
 
125
151
  From versions >= 3, everything should be usable in a much more a la carte manner. If all you care about is google page rank (which I speculate is common) you can get that all by itself:
@@ -2,6 +2,7 @@ require File.expand_path("../page_rankr/backlinks", __FILE__)
2
2
  require File.expand_path("../page_rankr/ranks", __FILE__)
3
3
  require File.expand_path("../page_rankr/indexes", __FILE__)
4
4
  require File.expand_path("../page_rankr/proxy_services", __FILE__)
5
+ require File.expand_path("../page_rankr/socials", __FILE__)
5
6
 
6
7
  module PageRankr
7
8
  class MethodRequired < StandardError; end
@@ -37,5 +38,14 @@ module PageRankr
37
38
  def index_trackers
38
39
  Indexes.new.index_trackers
39
40
  end
41
+
42
+ def socials(site, *social_trackers)
43
+ Socials.new.lookup(Site.new(site), *social_trackers)
44
+ end
45
+ alias_method :social, :socials
46
+
47
+ def social_trackers
48
+ Socials.new.social_trackers
49
+ end
40
50
  end
41
51
  end
@@ -0,0 +1,9 @@
1
+ require File.expand_path('../social', __FILE__)
2
+
3
+ module PageRankr
4
+ module Social
5
+ include Tracker
6
+
7
+ alias_method :social, :tracked
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path("../trackers", __FILE__)
2
+ require File.expand_path("../socials/facebook", __FILE__)
3
+ require File.expand_path("../socials/google", __FILE__)
4
+ require File.expand_path("../socials/linkedin", __FILE__)
5
+ require File.expand_path("../socials/pinterest", __FILE__)
6
+ require File.expand_path("../socials/stumble_upon", __FILE__)
7
+ require File.expand_path("../socials/twitter", __FILE__)
8
+ require File.expand_path("../socials/vk", __FILE__)
9
+
10
+ module PageRankr
11
+ class Socials
12
+ include Trackers
13
+
14
+ alias_method :social_trackers, :site_trackers
15
+ end
16
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class Facebook
6
+ include Social
7
+
8
+ def url
9
+ 'http://graph.facebook.com'
10
+ end
11
+
12
+ def params
13
+ {:id => tracked_url}
14
+ end
15
+
16
+ def jsonpath
17
+ 'shares'
18
+ end
19
+
20
+ def supported_components
21
+ [:subdomain, :path, :query, :scheme]
22
+ end
23
+
24
+ def name
25
+ :socials_facebook
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,30 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class Google
6
+ include Social
7
+
8
+ def url
9
+ # Yandex supplies Google +1 counts in a convenient matter without need for an API key
10
+ 'http://share.yandex.ru/gpp.xml'
11
+ end
12
+
13
+ def params
14
+ {:url => tracked_url}
15
+ end
16
+
17
+ def regex
18
+ /(\d+)/
19
+ end
20
+
21
+ def supported_components
22
+ [:subdomain, :path, :scheme]
23
+ end
24
+
25
+ def name
26
+ :socials_google
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class LinkedIn
6
+ include Social
7
+
8
+ def url
9
+ 'https://www.linkedin.com/countserv/count/share'
10
+ end
11
+
12
+ def params
13
+ {:url => tracked_url, :callback => '_', :format => 'json'}
14
+ end
15
+
16
+ def jsonpath
17
+ 'count'
18
+ end
19
+
20
+ def supported_components
21
+ [:subdomain, :path, :query]
22
+ end
23
+
24
+ def name
25
+ :socials_linked_in
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class Pinterest
6
+ include Social
7
+
8
+ def url
9
+ 'http://api.pinterest.com/v1/urls/count.json'
10
+ end
11
+
12
+ def params
13
+ {:url => tracked_url, :callback => '_'}
14
+ end
15
+
16
+ def regex
17
+ /(\d+)/
18
+ end
19
+
20
+ def supported_components
21
+ [:subdomain, :path, :scheme]
22
+ end
23
+
24
+ def name
25
+ :socials_pinterest
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class StumbleUpon
6
+ include Social
7
+
8
+ def url
9
+ 'http://www.stumbleupon.com/services/1.01/badge.getinfo'
10
+ end
11
+
12
+ def params
13
+ {:url => tracked_url}
14
+ end
15
+
16
+ def jsonpath
17
+ 'result.views'
18
+ end
19
+
20
+ def supported_components
21
+ [:subdomain, :path, :query]
22
+ end
23
+
24
+ def name
25
+ :socials_stumble_upon
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class Twitter
6
+ include Social
7
+
8
+ def url
9
+ 'http://urls.api.twitter.com/1/urls/count.json'
10
+ end
11
+
12
+ def params
13
+ {:url => tracked_url}
14
+ end
15
+
16
+ def jsonpath
17
+ 'count'
18
+ end
19
+
20
+ def supported_components
21
+ [:subdomain, :path, :query]
22
+ end
23
+
24
+ def name
25
+ :socials_twitter
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../../social', __FILE__)
2
+
3
+ module PageRankr
4
+ class Socials
5
+ class Vk
6
+ include Social
7
+
8
+ def url
9
+ 'http://vk.com/share.php'
10
+ end
11
+
12
+ def params
13
+ {:url => tracked_url, :act => 'count'}
14
+ end
15
+
16
+ def regex
17
+ /, (\d+)/
18
+ end
19
+
20
+ def supported_components
21
+ [:subdomain, :path, :scheme]
22
+ end
23
+
24
+ def name
25
+ :socials_vk
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module PageRankr
2
- VERSION = "4.3.0"
2
+ VERSION = "4.4.0"
3
3
  end
@@ -0,0 +1,298 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://vk.com/share.php?url=http%3A%2F%2Fplease-dont-register-a-site-that-breaks-this-test.com&act=count
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ user-agent:
11
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
12
+ like Gecko) Version/5.1.6 Safari/534.56.5
13
+ response:
14
+ status:
15
+ code: 200
16
+ message: OK
17
+ headers:
18
+ server:
19
+ - Apache
20
+ date:
21
+ - Mon, 15 Dec 2014 20:52:36 GMT
22
+ content-type:
23
+ - text/html; charset=windows-1251
24
+ content-length:
25
+ - '21'
26
+ connection:
27
+ - close
28
+ x-powered-by:
29
+ - PHP/3.9812
30
+ set-cookie:
31
+ - remixlang=3; expires=Tue, 22 Dec 2015 22:40:38 GMT; path=/; domain=.vk.com
32
+ pragma:
33
+ - no-cache
34
+ cache-control:
35
+ - no-store
36
+ body:
37
+ encoding: UTF-8
38
+ string: VK.Share.count(0, 0);
39
+ http_version: '1.1'
40
+ recorded_at: Mon, 15 Dec 2014 20:52:36 GMT
41
+ - request:
42
+ method: get
43
+ uri: http://api.pinterest.com/v1/urls/count.json?url=http%3A%2F%2Fplease-dont-register-a-site-that-breaks-this-test.com&callback=_
44
+ body:
45
+ encoding: US-ASCII
46
+ string: ''
47
+ headers:
48
+ user-agent:
49
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
50
+ like Gecko) Version/5.1.6 Safari/534.56.5
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ cache-control:
57
+ - private
58
+ content-type:
59
+ - application/javascript
60
+ expires:
61
+ - Mon, 15 Dec 2014 21:07:36 GMT
62
+ x-pinterest-rid:
63
+ - '636153528830'
64
+ x-varnish:
65
+ - '1881654558'
66
+ date:
67
+ - Mon, 15 Dec 2014 20:52:36 GMT
68
+ content-length:
69
+ - '83'
70
+ connection:
71
+ - close
72
+ body:
73
+ encoding: UTF-8
74
+ string: _({"url":"http://please-dont-register-a-site-that-breaks-this-test.com","count":0})
75
+ http_version: '1.1'
76
+ recorded_at: Mon, 15 Dec 2014 20:52:36 GMT
77
+ - request:
78
+ method: get
79
+ uri: http://urls.api.twitter.com/1/urls/count.json?url=please-dont-register-a-site-that-breaks-this-test.com
80
+ body:
81
+ encoding: US-ASCII
82
+ string: ''
83
+ headers:
84
+ user-agent:
85
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
86
+ like Gecko) Version/5.1.6 Safari/534.56.5
87
+ response:
88
+ status:
89
+ code: 200
90
+ message: OK
91
+ headers:
92
+ cache-control:
93
+ - max-age=900
94
+ content-type:
95
+ - application/json;charset=utf-8
96
+ date:
97
+ - Mon, 15 Dec 2014 20:52:36 UTC
98
+ expires:
99
+ - Mon, 15 Dec 2014 21:07:36 GMT
100
+ last-modified:
101
+ - Mon, 15 Dec 2014 20:52:36 GMT
102
+ server:
103
+ - tsa_b
104
+ set-cookie:
105
+ - guest_id=v1%3A141867675615480449; Domain=.twitter.com; Path=/; Expires=Wed,
106
+ 14-Dec-2016 20:52:36 UTC
107
+ x-connection-hash:
108
+ - 6879864c4711b1251048ae04745a40ca
109
+ x-response-time:
110
+ - '6'
111
+ content-length:
112
+ - '84'
113
+ connection:
114
+ - close
115
+ body:
116
+ encoding: UTF-8
117
+ string: '{"count":0,"url":"http:\/\/please-dont-register-a-site-that-breaks-this-test.com\/"}'
118
+ http_version: '1.1'
119
+ recorded_at: Mon, 15 Dec 2014 20:52:36 GMT
120
+ - request:
121
+ method: get
122
+ uri: http://graph.facebook.com/?id=http%3A%2F%2Fplease-dont-register-a-site-that-breaks-this-test.com
123
+ body:
124
+ encoding: US-ASCII
125
+ string: ''
126
+ headers:
127
+ user-agent:
128
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
129
+ like Gecko) Version/5.1.6 Safari/534.56.5
130
+ response:
131
+ status:
132
+ code: 200
133
+ message: OK
134
+ headers:
135
+ facebook-api-version:
136
+ - v1.0
137
+ etag:
138
+ - '"084a2bbc7382540addc052eab83eb70ab32dd140"'
139
+ content-type:
140
+ - text/javascript; charset=UTF-8
141
+ pragma:
142
+ - no-cache
143
+ access-control-allow-origin:
144
+ - '*'
145
+ x-fb-rev:
146
+ - '1532468'
147
+ cache-control:
148
+ - private, no-cache, no-store, must-revalidate
149
+ expires:
150
+ - Sat, 01 Jan 2000 00:00:00 GMT
151
+ x-fb-debug:
152
+ - 4/zxrMp4gd2uu90vkMfmKc2d7GCFBmIvr88Bmdt3XstyyPSqrrockxG8aUirZYHnqVrUKBQAlg9cltik9RpzIw==
153
+ date:
154
+ - Mon, 15 Dec 2014 20:52:36 GMT
155
+ connection:
156
+ - close
157
+ content-length:
158
+ - '75'
159
+ body:
160
+ encoding: UTF-8
161
+ string: |-
162
+ {
163
+ "id": "http://please-dont-register-a-site-that-breaks-this-test.com"
164
+ }
165
+ http_version: '1.1'
166
+ recorded_at: Mon, 15 Dec 2014 20:52:36 GMT
167
+ - request:
168
+ method: get
169
+ uri: https://www.linkedin.com/countserv/count/share?url=please-dont-register-a-site-that-breaks-this-test.com&callback=_&format=json
170
+ body:
171
+ encoding: US-ASCII
172
+ string: ''
173
+ headers:
174
+ user-agent:
175
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
176
+ like Gecko) Version/5.1.6 Safari/534.56.5
177
+ response:
178
+ status:
179
+ code: 200
180
+ message: OK
181
+ headers:
182
+ server:
183
+ - Apache-Coyote/1.1
184
+ content-type:
185
+ - application/json;charset=UTF-8
186
+ content-length:
187
+ - '102'
188
+ vary:
189
+ - Accept-Encoding
190
+ date:
191
+ - Mon, 15 Dec 2014 20:52:35 GMT
192
+ x-frame-options:
193
+ - sameorigin
194
+ x-content-type-options:
195
+ - nosniff
196
+ x-xss-protection:
197
+ - 1; mode=block
198
+ x-li-fabric:
199
+ - prod-ltx1
200
+ strict-transport-security:
201
+ - max-age=0
202
+ pragma:
203
+ - no-cache
204
+ expires:
205
+ - Thu, 01 Jan 1970 00:00:00 GMT
206
+ cache-control:
207
+ - no-cache, no-store
208
+ x-li-pop:
209
+ - PROD-IDB2
210
+ x-li-uuid:
211
+ - ur9AUv4msBPAW7IkeisAAA==
212
+ set-cookie:
213
+ - lidc="b=TB21:g=19:u=1:i=1418676756:t=1418763156:s=596180949"; Expires=Tue,
214
+ 16 Dec 2014 20:52:36 GMT; domain=.linkedin.com; Path=/
215
+ body:
216
+ encoding: UTF-8
217
+ string: '{"count":0,"fCnt":"0","fCntPlusOne":"1","url":"please-dont-register-a-site-that-breaks-this-test.com"}'
218
+ http_version: '1.1'
219
+ recorded_at: Mon, 15 Dec 2014 20:52:36 GMT
220
+ - request:
221
+ method: get
222
+ uri: http://share.yandex.ru/gpp.xml?url=http%3A%2F%2Fplease-dont-register-a-site-that-breaks-this-test.com
223
+ body:
224
+ encoding: US-ASCII
225
+ string: ''
226
+ headers:
227
+ user-agent:
228
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
229
+ like Gecko) Version/5.1.6 Safari/534.56.5
230
+ response:
231
+ status:
232
+ code: 200
233
+ message: OK
234
+ headers:
235
+ server:
236
+ - nginx/1.6.2
237
+ date:
238
+ - Mon, 15 Dec 2014 20:52:36 GMT
239
+ content-type:
240
+ - text/javascript; charset=utf-8
241
+ transfer-encoding:
242
+ - chunked
243
+ connection:
244
+ - close
245
+ cache-control:
246
+ - max-age=0, must-revalidate, proxy-revalidate, no-cache, no-store, private
247
+ expires:
248
+ - Mon, 15 Dec 2014 20:52:36 GMT
249
+ pragma:
250
+ - no-cache
251
+ set-cookie:
252
+ - yandexuid=2574829691418676756; domain=.yandex.ru; path=/; expires=Tue, 19
253
+ Jan 2038 03:14:07 GMT
254
+ body:
255
+ encoding: UTF-8
256
+ string: services.gplus.cb("0");
257
+ http_version: '1.1'
258
+ recorded_at: Mon, 15 Dec 2014 20:52:36 GMT
259
+ - request:
260
+ method: get
261
+ uri: http://www.stumbleupon.com/services/1.01/badge.getinfo?url=please-dont-register-a-site-that-breaks-this-test.com
262
+ body:
263
+ encoding: US-ASCII
264
+ string: ''
265
+ headers:
266
+ user-agent:
267
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
268
+ like Gecko) Version/5.1.6 Safari/534.56.5
269
+ response:
270
+ status:
271
+ code: 200
272
+ message: OK
273
+ headers:
274
+ server:
275
+ - Apache
276
+ p3p:
277
+ - policyref="/w3c/p3p.xml", CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT
278
+ DEM STA PRE COM NAV OTC NOI DSP COR"
279
+ vary:
280
+ - Accept-Encoding
281
+ content-type:
282
+ - text/plain; charset=iso-8859-1
283
+ content-length:
284
+ - '140'
285
+ accept-ranges:
286
+ - bytes
287
+ date:
288
+ - Mon, 15 Dec 2014 20:52:37 GMT
289
+ age:
290
+ - '0'
291
+ connection:
292
+ - close
293
+ body:
294
+ encoding: UTF-8
295
+ string: '{"result":{"url":"http:\/\/please-dont-register-a-site-that-breaks-this-test.com\/","in_index":false},"timestamp":1418676757,"success":true}'
296
+ http_version: '1.1'
297
+ recorded_at: Mon, 15 Dec 2014 20:52:37 GMT
298
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,302 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://vk.com/share.php?url=http%3A%2F%2Fwww.google.com&act=count
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ user-agent:
11
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
12
+ like Gecko) Version/5.1.6 Safari/534.56.5
13
+ response:
14
+ status:
15
+ code: 200
16
+ message: OK
17
+ headers:
18
+ server:
19
+ - Apache
20
+ date:
21
+ - Mon, 15 Dec 2014 20:52:34 GMT
22
+ content-type:
23
+ - text/html; charset=windows-1251
24
+ content-length:
25
+ - '24'
26
+ connection:
27
+ - close
28
+ x-powered-by:
29
+ - PHP/3.9812
30
+ set-cookie:
31
+ - remixlang=3; expires=Thu, 17 Dec 2015 16:12:36 GMT; path=/; domain=.vk.com
32
+ pragma:
33
+ - no-cache
34
+ cache-control:
35
+ - no-store
36
+ body:
37
+ encoding: UTF-8
38
+ string: VK.Share.count(0, 3725);
39
+ http_version: '1.1'
40
+ recorded_at: Mon, 15 Dec 2014 20:52:34 GMT
41
+ - request:
42
+ method: get
43
+ uri: http://api.pinterest.com/v1/urls/count.json?url=http%3A%2F%2Fwww.google.com&callback=_
44
+ body:
45
+ encoding: US-ASCII
46
+ string: ''
47
+ headers:
48
+ user-agent:
49
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
50
+ like Gecko) Version/5.1.6 Safari/534.56.5
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ accept-ranges:
57
+ - bytes
58
+ cache-control:
59
+ - private
60
+ content-type:
61
+ - application/javascript
62
+ expires:
63
+ - Mon, 15 Dec 2014 21:07:34 GMT
64
+ x-pinterest-rid:
65
+ - '420796907025'
66
+ x-varnish:
67
+ - '3153189879'
68
+ content-length:
69
+ - '48'
70
+ date:
71
+ - Mon, 15 Dec 2014 20:52:34 GMT
72
+ connection:
73
+ - close
74
+ body:
75
+ encoding: UTF-8
76
+ string: _({"url":"http://www.google.com","count":75108})
77
+ http_version: '1.1'
78
+ recorded_at: Mon, 15 Dec 2014 20:52:34 GMT
79
+ - request:
80
+ method: get
81
+ uri: http://graph.facebook.com/?id=http%3A%2F%2Fwww.google.com
82
+ body:
83
+ encoding: US-ASCII
84
+ string: ''
85
+ headers:
86
+ user-agent:
87
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
88
+ like Gecko) Version/5.1.6 Safari/534.56.5
89
+ response:
90
+ status:
91
+ code: 200
92
+ message: OK
93
+ headers:
94
+ facebook-api-version:
95
+ - v1.0
96
+ etag:
97
+ - '"b763721b57603f6520b06f4622e3f2ba5c6a722e"'
98
+ content-type:
99
+ - text/javascript; charset=UTF-8
100
+ pragma:
101
+ - no-cache
102
+ access-control-allow-origin:
103
+ - '*'
104
+ x-fb-rev:
105
+ - '1532468'
106
+ cache-control:
107
+ - private, no-cache, no-store, must-revalidate
108
+ expires:
109
+ - Sat, 01 Jan 2000 00:00:00 GMT
110
+ x-fb-debug:
111
+ - g5R1Oyw08FasCZhz5GfUXKQCI+BzYr1q4RDlS6ke0Uk276RwDb9fJ8mTYJvatpU0jz/glCqIRqQV+wdUQ2B2mg==
112
+ date:
113
+ - Mon, 15 Dec 2014 20:52:34 GMT
114
+ connection:
115
+ - close
116
+ content-length:
117
+ - '79'
118
+ body:
119
+ encoding: UTF-8
120
+ string: |-
121
+ {
122
+ "id": "http://www.google.com",
123
+ "shares": 10012603,
124
+ "comments": 934
125
+ }
126
+ http_version: '1.1'
127
+ recorded_at: Mon, 15 Dec 2014 20:52:34 GMT
128
+ - request:
129
+ method: get
130
+ uri: http://urls.api.twitter.com/1/urls/count.json?url=www.google.com
131
+ body:
132
+ encoding: US-ASCII
133
+ string: ''
134
+ headers:
135
+ user-agent:
136
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
137
+ like Gecko) Version/5.1.6 Safari/534.56.5
138
+ response:
139
+ status:
140
+ code: 200
141
+ message: OK
142
+ headers:
143
+ cache-control:
144
+ - max-age=900
145
+ content-type:
146
+ - application/json;charset=utf-8
147
+ date:
148
+ - Mon, 15 Dec 2014 20:52:34 UTC
149
+ expires:
150
+ - Mon, 15 Dec 2014 21:07:34 GMT
151
+ last-modified:
152
+ - Mon, 15 Dec 2014 20:52:34 GMT
153
+ server:
154
+ - tsa_b
155
+ set-cookie:
156
+ - guest_id=v1%3A141867675457322338; Domain=.twitter.com; Path=/; Expires=Wed,
157
+ 14-Dec-2016 20:52:34 UTC
158
+ x-connection-hash:
159
+ - 5839fc5d0eaaf756cee243cb1995c5c1
160
+ x-response-time:
161
+ - '3'
162
+ content-length:
163
+ - '52'
164
+ connection:
165
+ - close
166
+ body:
167
+ encoding: UTF-8
168
+ string: '{"count":21936956,"url":"http:\/\/www.google.com\/"}'
169
+ http_version: '1.1'
170
+ recorded_at: Mon, 15 Dec 2014 20:52:34 GMT
171
+ - request:
172
+ method: get
173
+ uri: http://share.yandex.ru/gpp.xml?url=http%3A%2F%2Fwww.google.com
174
+ body:
175
+ encoding: US-ASCII
176
+ string: ''
177
+ headers:
178
+ user-agent:
179
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
180
+ like Gecko) Version/5.1.6 Safari/534.56.5
181
+ response:
182
+ status:
183
+ code: 200
184
+ message: OK
185
+ headers:
186
+ server:
187
+ - nginx/1.6.2
188
+ date:
189
+ - Mon, 15 Dec 2014 20:52:34 GMT
190
+ content-type:
191
+ - text/javascript; charset=utf-8
192
+ transfer-encoding:
193
+ - chunked
194
+ connection:
195
+ - close
196
+ cache-control:
197
+ - max-age=0, must-revalidate, proxy-revalidate, no-cache, no-store, private
198
+ expires:
199
+ - Mon, 15 Dec 2014 20:52:34 GMT
200
+ pragma:
201
+ - no-cache
202
+ set-cookie:
203
+ - yandexuid=45368231418676754; domain=.yandex.ru; path=/; expires=Tue, 19 Jan
204
+ 2038 03:14:07 GMT
205
+ body:
206
+ encoding: UTF-8
207
+ string: services.gplus.cb("10000");
208
+ http_version: '1.1'
209
+ recorded_at: Mon, 15 Dec 2014 20:52:34 GMT
210
+ - request:
211
+ method: get
212
+ uri: https://www.linkedin.com/countserv/count/share?url=www.google.com&callback=_&format=json
213
+ body:
214
+ encoding: US-ASCII
215
+ string: ''
216
+ headers:
217
+ user-agent:
218
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
219
+ like Gecko) Version/5.1.6 Safari/534.56.5
220
+ response:
221
+ status:
222
+ code: 200
223
+ message: OK
224
+ headers:
225
+ server:
226
+ - Apache-Coyote/1.1
227
+ content-type:
228
+ - application/json;charset=UTF-8
229
+ content-length:
230
+ - '74'
231
+ vary:
232
+ - Accept-Encoding
233
+ date:
234
+ - Mon, 15 Dec 2014 20:52:34 GMT
235
+ x-frame-options:
236
+ - sameorigin
237
+ x-content-type-options:
238
+ - nosniff
239
+ x-xss-protection:
240
+ - 1; mode=block
241
+ x-li-fabric:
242
+ - prod-ltx1
243
+ strict-transport-security:
244
+ - max-age=0
245
+ pragma:
246
+ - no-cache
247
+ expires:
248
+ - Thu, 01 Jan 1970 00:00:00 GMT
249
+ cache-control:
250
+ - no-cache, no-store
251
+ x-li-pop:
252
+ - PROD-IDB2
253
+ x-li-uuid:
254
+ - YZcC9v0msBOg4JUkeisAAA==
255
+ set-cookie:
256
+ - lidc="b=TB21:g=19:u=1:i=1418676754:t=1418763154:s=498524689"; Expires=Tue,
257
+ 16 Dec 2014 20:52:34 GMT; domain=.linkedin.com; Path=/
258
+ body:
259
+ encoding: UTF-8
260
+ string: '{"count":1023,"fCnt":"1,023","fCntPlusOne":"1,024","url":"www.google.com"}'
261
+ http_version: '1.1'
262
+ recorded_at: Mon, 15 Dec 2014 20:52:34 GMT
263
+ - request:
264
+ method: get
265
+ uri: http://www.stumbleupon.com/services/1.01/badge.getinfo?url=www.google.com
266
+ body:
267
+ encoding: US-ASCII
268
+ string: ''
269
+ headers:
270
+ user-agent:
271
+ - Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.56.5 (KHTML,
272
+ like Gecko) Version/5.1.6 Safari/534.56.5
273
+ response:
274
+ status:
275
+ code: 200
276
+ message: OK
277
+ headers:
278
+ server:
279
+ - Apache
280
+ p3p:
281
+ - policyref="/w3c/p3p.xml", CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT
282
+ DEM STA PRE COM NAV OTC NOI DSP COR"
283
+ vary:
284
+ - Accept-Encoding
285
+ content-type:
286
+ - text/plain; charset=iso-8859-1
287
+ content-length:
288
+ - '521'
289
+ accept-ranges:
290
+ - bytes
291
+ date:
292
+ - Mon, 15 Dec 2014 20:52:34 GMT
293
+ age:
294
+ - '0'
295
+ connection:
296
+ - close
297
+ body:
298
+ encoding: UTF-8
299
+ string: '{"result":{"url":"http:\/\/www.google.com\/","in_index":true,"publicid":"2pI1xR","views":255079,"title":"Google","thumbnail":"http:\/\/cdn.stumble-upon.com\/mthumb\/31\/10031.jpg","thumbnail_b":"http:\/\/cdn.stumble-upon.com\/bthumb\/31\/10031.jpg","submit_link":"http:\/\/www.stumbleupon.com\/badge\/?url=http:\/\/www.google.com\/","badge_link":"http:\/\/www.stumbleupon.com\/badge\/?url=http:\/\/www.google.com\/","info_link":"http:\/\/www.stumbleupon.com\/url\/www.google.com\/"},"timestamp":1418676754,"success":true}'
300
+ http_version: '1.1'
301
+ recorded_at: Mon, 15 Dec 2014 20:52:35 GMT
302
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,66 @@
1
+ require 'spec_helper'
2
+
3
+ describe PageRankr do
4
+ describe "#socials" do
5
+ subject{ PageRankr.social_trackers }
6
+
7
+ it{ should include(:facebook) }
8
+ it{ should include(:google) }
9
+ it{ should include(:linked_in) }
10
+ it{ should include(:pinterest) }
11
+ it{ should include(:stumble_upon) }
12
+ it{ should include(:twitter) }
13
+ it{ should include(:vk) }
14
+ end
15
+
16
+ describe "#socials", :focus => true do
17
+ describe "success" do
18
+ subject do
19
+ VCR.use_cassette(:success_socials, :record => :new_episodes) do
20
+ PageRankr.socials("http://www.google.com")
21
+ end
22
+ end
23
+
24
+ it{ should have_key(:facebook) }
25
+ it{ should have_key(:google) }
26
+ it{ should have_key(:linked_in) }
27
+ it{ should have_key(:pinterest) }
28
+ it{ should have_key(:stumble_upon) }
29
+ it{ should have_key(:twitter) }
30
+ it{ should have_key(:vk) }
31
+
32
+ it{ subject[:facebook].should > 1000000 }
33
+ it{ subject[:google].should > 5000 }
34
+ it{ subject[:linked_in].should > 500 }
35
+ it{ subject[:pinterest].should > 70000 }
36
+ it{ subject[:stumble_upon].should > 20000 }
37
+ it{ subject[:twitter].should > 100000 }
38
+ it{ subject[:vk].should > 3000 }
39
+ end
40
+
41
+ describe "failure" do
42
+ subject do
43
+ VCR.use_cassette(:failure_socials, :record => :new_episodes) do
44
+ PageRankr.socials("http://please-dont-register-a-site-that-breaks-this-test.com")
45
+ end
46
+ end
47
+
48
+ it{ should have_key(:facebook) }
49
+ it{ should have_key(:google) }
50
+ it{ should have_key(:linked_in) }
51
+ it{ should have_key(:pinterest) }
52
+ it{ should have_key(:stumble_upon) }
53
+ it{ should have_key(:twitter) }
54
+ it{ should have_key(:vk) }
55
+
56
+ it{ subject[:facebook].should be_nil }
57
+ it{ subject[:google].should == 0 }
58
+ it{ subject[:linked_in].should == 0 }
59
+ it{ subject[:pinterest].should == 0 }
60
+ it{ subject[:stumble_upon].should be_nil }
61
+ it{ subject[:twitter].should == 0 }
62
+ it{ subject[:vk].should == 0 }
63
+ end
64
+ end
65
+
66
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PageRankr
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Madsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2014-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 2.9.3
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 2.9.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: fakeweb
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -164,8 +164,8 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.4.2
167
- description: Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, and
168
- index counts.
167
+ description: Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, index
168
+ counts and different types of social signals
169
169
  email:
170
170
  - blatyo@gmail.com
171
171
  executables: []
@@ -210,6 +210,15 @@ files:
210
210
  - lib/page_rankr/ranks/page_authority.rb
211
211
  - lib/page_rankr/request.rb
212
212
  - lib/page_rankr/site.rb
213
+ - lib/page_rankr/social.rb
214
+ - lib/page_rankr/socials.rb
215
+ - lib/page_rankr/socials/facebook.rb
216
+ - lib/page_rankr/socials/google.rb
217
+ - lib/page_rankr/socials/linkedin.rb
218
+ - lib/page_rankr/socials/pinterest.rb
219
+ - lib/page_rankr/socials/stumble_upon.rb
220
+ - lib/page_rankr/socials/twitter.rb
221
+ - lib/page_rankr/socials/vk.rb
213
222
  - lib/page_rankr/tracker.rb
214
223
  - lib/page_rankr/trackers.rb
215
224
  - lib/page_rankr/version.rb
@@ -219,14 +228,17 @@ files:
219
228
  - spec/fixtures/vcr_cassettes/failure_backlinks.yml
220
229
  - spec/fixtures/vcr_cassettes/failure_indexes.yml
221
230
  - spec/fixtures/vcr_cassettes/failure_ranks.yml
231
+ - spec/fixtures/vcr_cassettes/failure_socials.yml
222
232
  - spec/fixtures/vcr_cassettes/success_backlinks.yml
223
233
  - spec/fixtures/vcr_cassettes/success_indexes.yml
224
234
  - spec/fixtures/vcr_cassettes/success_ranks.yml
235
+ - spec/fixtures/vcr_cassettes/success_socials.yml
225
236
  - spec/page_rankr_spec.rb
226
237
  - spec/proxy_services/random_spec.rb
227
238
  - spec/proxy_services/round_robin_spec.rb
228
239
  - spec/ranks/google/checksum_spec.rb
229
240
  - spec/site_spec.rb
241
+ - spec/socials_spec.rb
230
242
  - spec/spec_helper.rb
231
243
  homepage: http://github.com/blatyo/page_rankr
232
244
  licenses:
@@ -248,24 +260,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
260
  version: 1.3.6
249
261
  requirements: []
250
262
  rubyforge_project:
251
- rubygems_version: 2.4.2
263
+ rubygems_version: 2.2.2
252
264
  signing_key:
253
265
  specification_version: 4
254
- summary: Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, and index
255
- counts.
266
+ summary: Easy way to retrieve Google Page Rank, Alexa Rank, backlink counts, index
267
+ counts and different types of social signals
256
268
  test_files:
257
269
  - spec/edge_cases_spec.rb
258
270
  - spec/fixtures/vcr_cassettes/alexa_ranks_edge_case_1.yml
259
271
  - spec/fixtures/vcr_cassettes/failure_backlinks.yml
260
272
  - spec/fixtures/vcr_cassettes/failure_indexes.yml
261
273
  - spec/fixtures/vcr_cassettes/failure_ranks.yml
274
+ - spec/fixtures/vcr_cassettes/failure_socials.yml
262
275
  - spec/fixtures/vcr_cassettes/success_backlinks.yml
263
276
  - spec/fixtures/vcr_cassettes/success_indexes.yml
264
277
  - spec/fixtures/vcr_cassettes/success_ranks.yml
278
+ - spec/fixtures/vcr_cassettes/success_socials.yml
265
279
  - spec/page_rankr_spec.rb
266
280
  - spec/proxy_services/random_spec.rb
267
281
  - spec/proxy_services/round_robin_spec.rb
268
282
  - spec/ranks/google/checksum_spec.rb
269
283
  - spec/site_spec.rb
284
+ - spec/socials_spec.rb
270
285
  - spec/spec_helper.rb
271
- has_rdoc: