linkscape 0.2.7 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +83 -26
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/linkscape/constants.rb +137 -10
- data/lib/linkscape/constants/anchor-metrics.rb +13 -13
- data/lib/linkscape/constants/link-metrics.rb +18 -18
- data/lib/linkscape/constants/url-metrics.rb +206 -36
- data/lib/linkscape/response.rb +9 -4
- data/linkscape.gemspec +26 -28
- metadata +16 -9
- data/.gitignore +0 -21
data/README.rdoc
CHANGED
@@ -132,40 +132,98 @@ Depending on the type of data point return, you may access certain data points i
|
|
132
132
|
|
133
133
|
=== Source/Target/URL Metrics
|
134
134
|
|
135
|
-
* <tt>:
|
136
|
-
* <tt>:
|
137
|
-
* <tt>:
|
138
|
-
* <tt>:
|
135
|
+
* <tt>:all_external_links</tt>
|
136
|
+
* <tt>:canonical_internal_id</tt>
|
137
|
+
* <tt>:canonical_url</tt>
|
138
|
+
* <tt>:cblocks_linking</tt>
|
139
|
+
* <tt>:domain_authority</tt>
|
140
|
+
* <tt>:domain_authority_raw</tt>
|
141
|
+
* <tt>:external_links</tt>
|
142
|
+
* <tt>:external_mozrank</tt>
|
143
|
+
* <tt>:external_mozrank_raw</tt>
|
139
144
|
* <tt>:fq_domain</tt>
|
145
|
+
* <tt>:fq_domain_all_external_links</tt>
|
146
|
+
* <tt>:fq_domain_external_links</tt>
|
147
|
+
* <tt>:fq_domain_external_mozrank_sum</tt>
|
148
|
+
* <tt>:fq_domain_external_mozrank_sum_raw</tt>
|
149
|
+
* <tt>:fq_domain_fq_domains_linking</tt>
|
150
|
+
* <tt>:fq_domain_internal_links</tt>
|
151
|
+
* <tt>:fq_domain_juice_fq_domains_linking</tt>
|
152
|
+
* <tt>:fq_domain_juice_internal_links</tt>
|
153
|
+
* <tt>:fq_domain_juice_links</tt>
|
154
|
+
* <tt>:fq_domain_juice_pl_domains_linking</tt>
|
155
|
+
* <tt>:fq_domain_links</tt>
|
156
|
+
* <tt>:fq_domain_mozrank</tt>
|
157
|
+
* <tt>:fq_domain_mozrank_raw</tt>
|
158
|
+
* <tt>:fq_domain_mozrank_sum</tt>
|
159
|
+
* <tt>:fq_domain_mozrank_sum_raw</tt>
|
140
160
|
* <tt>:fq_domain_moztrust</tt>
|
161
|
+
* <tt>:fq_domain_moztrust_raw</tt>
|
141
162
|
* <tt>:fq_domain_pl_domains_linking</tt>
|
142
|
-
* <tt>:
|
143
|
-
* <tt>:
|
163
|
+
* <tt>:fq_domain_unfollowed_external_links</tt>
|
164
|
+
* <tt>:fq_domain_unfollowed_fq_domains_linking</tt>
|
165
|
+
* <tt>:fq_domain_unfollowed_internal_links</tt>
|
166
|
+
* <tt>:fq_domain_unfollowed_links</tt>
|
167
|
+
* <tt>:fq_domain_unfollowed_pl_domains_linking</tt>
|
168
|
+
* <tt>:fq_domain_updated_at</tt>
|
169
|
+
* <tt>:fq_domains_linking</tt>
|
170
|
+
* <tt>:internal_id</tt>
|
171
|
+
* <tt>:internal_links</tt>
|
172
|
+
* <tt>:ips_linking</tt>
|
173
|
+
* <tt>:juice_cblocks_linking</tt>
|
174
|
+
* <tt>:juice_fq_domains_linking</tt>
|
175
|
+
* <tt>:juice_internal_links</tt>
|
176
|
+
* <tt>:juice_ips_linking</tt>
|
177
|
+
* <tt>:juice_links</tt>
|
178
|
+
* <tt>:juice_pl_domains_linking</tt>
|
179
|
+
* <tt>:links</tt>
|
180
|
+
* <tt>:mozrank</tt>
|
181
|
+
* <tt>:mozrank_raw</tt>
|
182
|
+
* <tt>:moztrust</tt>
|
183
|
+
* <tt>:moztrust_raw</tt>
|
184
|
+
* <tt>:page_authority</tt>
|
144
185
|
* <tt>:page_authority_raw</tt>
|
186
|
+
* <tt>:pl_domain</tt>
|
187
|
+
* <tt>:pl_domain_all_external_links</tt>
|
188
|
+
* <tt>:pl_domain_cblocks_linking</tt>
|
189
|
+
* <tt>:pl_domain_external_links</tt>
|
190
|
+
* <tt>:pl_domain_external_mozrank_sum</tt>
|
145
191
|
* <tt>:pl_domain_external_mozrank_sum_raw</tt>
|
146
|
-
* <tt>:
|
147
|
-
* <tt>:
|
192
|
+
* <tt>:pl_domain_internal_links</tt>
|
193
|
+
* <tt>:pl_domain_ips_linking</tt>
|
194
|
+
* <tt>:pl_domain_juice_cblocks_linking</tt>
|
195
|
+
* <tt>:pl_domain_juice_internal_links</tt>
|
196
|
+
* <tt>:pl_domain_juice_ips_linking</tt>
|
197
|
+
* <tt>:pl_domain_juice_links</tt>
|
198
|
+
* <tt>:pl_domain_juice_pl_domains_linking</tt>
|
199
|
+
* <tt>:pl_domain_links</tt>
|
148
200
|
* <tt>:pl_domain_mozrank</tt>
|
149
|
-
* <tt>:
|
150
|
-
* <tt>:
|
151
|
-
* <tt>:fq_domains_linking</tt>
|
152
|
-
* <tt>:page_authority</tt>
|
153
|
-
* <tt>:fq_domain_external_mozrank_sum_raw</tt>
|
154
|
-
* <tt>:pl_domain_moztrust</tt>
|
155
|
-
* <tt>:fq_domain_external_links</tt>
|
156
|
-
* <tt>:domain_authority_raw</tt>
|
157
|
-
* <tt>:canonical_url</tt>
|
201
|
+
* <tt>:pl_domain_mozrank_raw</tt>
|
202
|
+
* <tt>:pl_domain_mozrank_sum</tt>
|
158
203
|
* <tt>:pl_domain_mozrank_sum_raw</tt>
|
159
|
-
* <tt>:
|
160
|
-
* <tt>:
|
161
|
-
* <tt>:mozrank</tt>
|
204
|
+
* <tt>:pl_domain_moztrust</tt>
|
205
|
+
* <tt>:pl_domain_moztrust_raw</tt>
|
162
206
|
* <tt>:pl_domain_pl_domains_linking</tt>
|
163
|
-
* <tt>:
|
164
|
-
* <tt>:
|
207
|
+
* <tt>:pl_domain_unfollowed_cblocks_linking</tt>
|
208
|
+
* <tt>:pl_domain_unfollowed_external_links</tt>
|
209
|
+
* <tt>:pl_domain_unfollowed_internal_links</tt>
|
210
|
+
* <tt>:pl_domain_unfollowed_ips_linking</tt>
|
211
|
+
* <tt>:pl_domain_unfollowed_links</tt>
|
212
|
+
* <tt>:pl_domain_unfollowed_pl_domains_linking</tt>
|
213
|
+
* <tt>:pl_domain_updated_at</tt>
|
165
214
|
* <tt>:pl_domains_linking</tt>
|
166
|
-
* <tt>:
|
167
|
-
* <tt>:
|
168
|
-
* <tt>:
|
215
|
+
* <tt>:status</tt>
|
216
|
+
* <tt>:title</tt>
|
217
|
+
* <tt>:unfollowed_cblocks_linking</tt>
|
218
|
+
* <tt>:unfollowed_external_links</tt>
|
219
|
+
* <tt>:unfollowed_fq_domains_linking</tt>
|
220
|
+
* <tt>:unfollowed_internal_links</tt>
|
221
|
+
* <tt>:unfollowed_ips_linking</tt>
|
222
|
+
* <tt>:unfollowed_links</tt>
|
223
|
+
* <tt>:unfollowed_pl_domains_linking</tt>
|
224
|
+
* <tt>:updated_at</tt>
|
225
|
+
* <tt>:url</tt>
|
226
|
+
|
169
227
|
|
170
228
|
=== Link Metrics
|
171
229
|
|
@@ -182,7 +240,6 @@ Depending on the type of data point return, you may access certain data points i
|
|
182
240
|
* <tt>:text</tt>
|
183
241
|
* <tt>:internal_subdomains_linking</tt>
|
184
242
|
* <tt>:external_domains_linking</tt>
|
185
|
-
* <tt>:all</tt>
|
186
243
|
* <tt>:record_id</tt>
|
187
244
|
* <tt>:external_pages_linking</tt>
|
188
245
|
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ begin
|
|
9
9
|
gem.description = %Q{Provides an interface to SEOmoz's suite of APIs, including the free and site intelligence APIs.}
|
10
10
|
gem.email = %q{api@seomoz.org}
|
11
11
|
gem.homepage = "http://github.com/seomoz/linkscape-gem"
|
12
|
-
gem.authors = ["
|
12
|
+
gem.authors = ["Martin Tithonium", "Jeff Pollard", "Bryce Howard"]
|
13
13
|
gem.add_dependency "ruby-hmac", ">= 0"
|
14
14
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
15
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/linkscape/constants.rb
CHANGED
@@ -242,6 +242,98 @@ module Linkscape
|
|
242
242
|
:desc => %Q[The pay-level domain (PL domain) as it's identified in the Linkscape index],
|
243
243
|
},
|
244
244
|
|
245
|
+
:ued => {
|
246
|
+
:key => :all_external_links,
|
247
|
+
:name => 'All external links page to page',
|
248
|
+
:desc => %Q[The number of external links from one page to another (included followed and nofollowed).]
|
249
|
+
},
|
250
|
+
:ujfq => {
|
251
|
+
:key => :juice_fq_domains_linking,
|
252
|
+
:name => 'Followed Domains Linking Page',
|
253
|
+
:desc => %Q[The number of unique domains with followed links to the target url.]
|
254
|
+
},
|
255
|
+
:ujp => {
|
256
|
+
:key => :juice_ips_linking,
|
257
|
+
:name => 'Followed IPs Linking',
|
258
|
+
:desc => %Q[The number unique IPs with a followable link to a target url.]
|
259
|
+
},
|
260
|
+
:uip => {
|
261
|
+
:key => :ips_linking,
|
262
|
+
:name => 'IPs Linking',
|
263
|
+
:desc => %Q[The total number of unique IPs linking to a target url.]
|
264
|
+
},
|
265
|
+
:ujpl => {
|
266
|
+
:key => :juice_pl_domains_linking,
|
267
|
+
:name => 'Followed Domains to Page',
|
268
|
+
:desc => %Q[The number of unique domains with followed links to a given url.]
|
269
|
+
},
|
270
|
+
:uib => {
|
271
|
+
:key => :cblocks_linking,
|
272
|
+
:name => 'All Cblock Linking',
|
273
|
+
:desc => %Q[The total number unique cblocks linking to a page.]
|
274
|
+
},
|
275
|
+
:ujb => {
|
276
|
+
:key => :juice_cblocks_linking,
|
277
|
+
:name => 'Followed CBLocks Linking',
|
278
|
+
:desc => %Q[The total number unique cblocks with followed links to a page.]
|
279
|
+
},
|
280
|
+
:fjid => {
|
281
|
+
:key => :fq_domain_juice_links,
|
282
|
+
:name => 'Followed Subdomain Linking Domains',
|
283
|
+
:desc => %Q[A count of all unique subdomains with followed links to the target domain.]
|
284
|
+
},
|
285
|
+
:fed => {
|
286
|
+
:key => :fq_domain_all_external_links,
|
287
|
+
:name => 'Subdomain External Links',
|
288
|
+
:desc => %Q[The total number (followed and nofollowed) external links to the subdomain of the url.]
|
289
|
+
},
|
290
|
+
:fjf => {
|
291
|
+
:key => :fq_domain_juice_fq_domains_linking,
|
292
|
+
:name => 'Followed Subdomain Subdomains Links',
|
293
|
+
:desc => %Q[The number of subdomains with followed links to the subdomain of the url.]
|
294
|
+
},
|
295
|
+
:fjd => {
|
296
|
+
:key => :fq_domain_juice_pl_domains_linking,
|
297
|
+
:name => 'Followed Domain Subdomains Links',
|
298
|
+
:desc => %Q[The number of unique domains with followed links to the subdomain of the url.]
|
299
|
+
},
|
300
|
+
:pjid => {
|
301
|
+
:key => :pl_domain_juice_links,
|
302
|
+
:name => 'Followed Root Domain Links',
|
303
|
+
:desc => %Q[The total number of followed links (both internal and external) from a page to a domain.]
|
304
|
+
},
|
305
|
+
:ped => {
|
306
|
+
:key => :pl_domain_all_external_links,
|
307
|
+
:name => 'All Root Domain External Links',
|
308
|
+
:desc => %Q[The total number of external links (both followed and no-followed) from a page to a domain.]
|
309
|
+
},
|
310
|
+
:pjd => {
|
311
|
+
:key => :pl_domain_juice_pl_domains_linking,
|
312
|
+
:name => 'All Followed Root Domains Linking Domain',
|
313
|
+
:desc => %Q[The total number of followed root domains linking to the target's domain.]
|
314
|
+
},
|
315
|
+
:pip => {
|
316
|
+
:key => :pl_domain_ips_linking,
|
317
|
+
:name => 'IPs Linking to Domain',
|
318
|
+
:desc => %Q[The total number of unique IPs linking to the target's domain.]
|
319
|
+
},
|
320
|
+
:pjip => {
|
321
|
+
:key => :pl_domain_juice_ips_linking,
|
322
|
+
:name => 'Followed IPs Linking to Domain',
|
323
|
+
:desc => %Q[The total number of unique IPs with followed links to the target's domain.]
|
324
|
+
},
|
325
|
+
:pib => {
|
326
|
+
:key => :pl_domain_cblocks_linking,
|
327
|
+
:name => 'All Cblock Linking Domain',
|
328
|
+
:desc => %Q[The number of unique cblocks with a link to a domain.]
|
329
|
+
},
|
330
|
+
:pjb => {
|
331
|
+
:key => :pl_domain_juice_cblocks_linking,
|
332
|
+
:name => 'Followed Cblock Linking Domain',
|
333
|
+
:desc => %Q[The total number of cblock with followed links to a domain.]
|
334
|
+
},
|
335
|
+
|
336
|
+
|
245
337
|
:upa => {
|
246
338
|
:name => 'Page Authority',
|
247
339
|
:key => :page_authority,
|
@@ -268,8 +360,8 @@ module Linkscape
|
|
268
360
|
nil => :source,
|
269
361
|
:lu => :target,
|
270
362
|
}
|
271
|
-
|
272
|
-
|
363
|
+
|
364
|
+
|
273
365
|
LinkResponseFields = {
|
274
366
|
:t => {
|
275
367
|
:name => 'Anchor Text',
|
@@ -311,8 +403,8 @@ module Linkscape
|
|
311
403
|
LinkResponsePrefixes = {
|
312
404
|
:l => :link,
|
313
405
|
}
|
314
|
-
|
315
|
-
|
406
|
+
|
407
|
+
|
316
408
|
AnchorResponseFields = {
|
317
409
|
:t => {
|
318
410
|
:name => 'Anchor Text',
|
@@ -374,10 +466,45 @@ module Linkscape
|
|
374
466
|
:atf => :anchor,
|
375
467
|
:atu => :anchor,
|
376
468
|
}
|
377
|
-
|
378
|
-
|
469
|
+
|
470
|
+
# For values calculated from other values.
|
471
|
+
# format is [ :unknown_fraction, [ :whole_value, :known_fraction ] ]
|
472
|
+
# result is data[:unknown_fraction] = data[:whole_value] - data[:known_fraction]
|
473
|
+
# IFF both data[:whole_value] and data[:known_fraction] are present.
|
474
|
+
#
|
475
|
+
# Some calculated values are based on other calculated values,
|
476
|
+
# so be careful about the ordering of the list.
|
477
|
+
CalculationKeyMap = [
|
478
|
+
[:unfollowed_external_links, [ :all_external_links, :external_links ]],
|
479
|
+
[:unfollowed_links, [ :links, :juice_links ]],
|
480
|
+
[:juice_internal_links, [ :juice_links, :external_links ]],
|
481
|
+
[:internal_links, [ :links, :all_external_links ]],
|
482
|
+
[:unfollowed_internal_links, [ :internal_links, :juice_internal_links ]],
|
483
|
+
|
484
|
+
[:fq_domain_unfollowed_external_links, [ :fq_domain_all_external_links, :fq_domain_external_links ]],
|
485
|
+
[:fq_domain_unfollowed_links, [ :fq_domain_links, :fq_domain_juice_links ]],
|
486
|
+
[:fq_domain_juice_internal_links, [ :fq_domain_juice_links, :fq_domain_external_links ]],
|
487
|
+
[:fq_domain_internal_links, [ :fq_domain_links, :fq_domain_all_external_links ]],
|
488
|
+
[:fq_domain_unfollowed_internal_links, [ :fq_domain_internal_links, :fq_domain_juice_internal_links ]],
|
489
|
+
|
490
|
+
[:pl_domain_unfollowed_external_links, [ :pl_domain_all_external_links, :pl_domain_external_links ]],
|
491
|
+
[:pl_domain_unfollowed_links, [ :pl_domain_links, :pl_domain_juice_links ]],
|
492
|
+
[:pl_domain_juice_internal_links, [ :pl_domain_juice_links, :pl_domain_external_links ]],
|
493
|
+
[:pl_domain_internal_links, [ :pl_domain_links, :pl_domain_all_external_links ]],
|
494
|
+
[:pl_domain_unfollowed_internal_links, [ :pl_domain_internal_links, :pl_domain_juice_internal_links ]],
|
495
|
+
|
496
|
+
[:unfollowed_fq_domains_linking, [ :fq_domains_linking, :juice_fq_domains_linking ]],
|
497
|
+
[:unfollowed_pl_domains_linking, [ :pl_domains_linking, :juice_pl_domains_linking ]],
|
498
|
+
[:fq_domain_unfollowed_fq_domains_linking, [ :fq_domain_fq_domains_linking, :fq_domain_juice_fq_domains_linking ]],
|
499
|
+
[:pl_domain_unfollowed_pl_domains_linking, [ :pl_domain_pl_domains_linking, :pl_domain_juice_pl_domains_linking ]],
|
500
|
+
[:fq_domain_unfollowed_pl_domains_linking, [ :fq_domain_pl_domains_linking, :fq_domain_juice_pl_domains_linking ]],
|
501
|
+
[:unfollowed_ips_linking, [ :ips_linking, :juice_ips_linking ]],
|
502
|
+
[:unfollowed_cblocks_linking, [ :cblocks_linking, :juice_cblocks_linking ]],
|
503
|
+
[:pl_domain_unfollowed_cblocks_linking, [ :pl_domain_cblocks_linking, :pl_domain_juice_cblocks_linking ]],
|
504
|
+
[:pl_domain_unfollowed_ips_linking, [ :pl_domain_ips_linking, :pl_domain_juice_ips_linking ]],
|
505
|
+
]
|
379
506
|
ResponseFields = {}
|
380
|
-
|
507
|
+
|
381
508
|
URLResponsePrefixes.each do |prefix, subject|
|
382
509
|
URLResponseFields.each do |k,v|
|
383
510
|
v = v.dup.merge(
|
@@ -408,11 +535,11 @@ module Linkscape
|
|
408
535
|
ResponseFields[v[:source]] = v
|
409
536
|
end
|
410
537
|
end
|
411
|
-
|
538
|
+
|
412
539
|
ResponseFields.keys.each {|k| ResponseFields[ResponseFields[k][:key]] ||= ResponseFields[k] if ResponseFields[k][:key] }
|
413
|
-
|
540
|
+
|
414
541
|
LongestNameLength = ResponseFields.collect{|k,v|v[:name].length}.max
|
415
542
|
LongestKeyLength = ResponseFields.collect{|k,v|v[:key].to_s.length}.max
|
416
|
-
|
543
|
+
|
417
544
|
end
|
418
545
|
end
|
@@ -5,65 +5,65 @@ module Linkscape
|
|
5
5
|
RequestBits = {
|
6
6
|
:text => {
|
7
7
|
:name => 'text',
|
8
|
-
:flag => 2,
|
8
|
+
:flag => 2**1, # 2
|
9
9
|
:desc => %Q[The anchor text term or phrase]
|
10
10
|
},
|
11
11
|
:record_id => {
|
12
12
|
:name => 'record_id',
|
13
|
-
:flag => 4
|
13
|
+
:flag => 2**2, # 4
|
14
14
|
:desc => %Q[Internal record ID of the target]
|
15
15
|
},
|
16
16
|
:internal_pages_linking => {
|
17
17
|
:name => 'Internal Pages Linking',
|
18
|
-
:flag => 8
|
18
|
+
:flag => 2**3, # 8
|
19
19
|
:desc => %Q[the number of internal pages linking]
|
20
20
|
},
|
21
21
|
:internal_subdomains_linking => {
|
22
22
|
:name => 'Internal Subdomains Linking',
|
23
|
-
:flag => 16
|
23
|
+
:flag => 2**4, # 16
|
24
24
|
:desc => %Q[the number of internal subdomains linking]
|
25
25
|
},
|
26
26
|
:external_pages_linking => {
|
27
27
|
:name => 'External Pages Linking',
|
28
|
-
:flag => 32
|
28
|
+
:flag => 2**5, # 32
|
29
29
|
:desc => %Q[the number of external pages linking]
|
30
30
|
},
|
31
31
|
:external_subdomains_linking => {
|
32
32
|
:name => 'External Subdomains Linking',
|
33
|
-
:flag => 64
|
33
|
+
:flag => 2**6, # 64
|
34
34
|
:desc => %Q[the number of external subdomains linking]
|
35
35
|
},
|
36
36
|
:external_domains_linking => {
|
37
37
|
:name => 'External Domains Linking',
|
38
|
-
:flag => 128
|
38
|
+
:flag => 2**7, # 128
|
39
39
|
:desc => %Q[the number of external domains linking]
|
40
40
|
},
|
41
41
|
:internal_mozrank => {
|
42
42
|
:name => 'Internal mozRank',
|
43
|
-
:flag => 256
|
43
|
+
:flag => 2**8, # 256
|
44
44
|
:desc => %Q[the sum of mozRank passed along internal links]
|
45
45
|
},
|
46
46
|
:external_mozrank => {
|
47
47
|
:name => 'External mozRank',
|
48
|
-
:flag => 512
|
48
|
+
:flag => 2**9, # 512
|
49
49
|
:desc => %Q[the sum of mozRank passed along external links]
|
50
50
|
},
|
51
51
|
:flags => {
|
52
52
|
:name => 'Flags',
|
53
|
-
:flag => 1024
|
53
|
+
:flag => 2**10, # 1024
|
54
54
|
:desc => %Q[a flags column]
|
55
55
|
},
|
56
56
|
}
|
57
57
|
RequestBits[:all] = {
|
58
|
-
:name => 'All
|
59
|
-
:flag => RequestBits.keys.inject(0) {|sum,k| sum
|
58
|
+
:name => 'All columns',
|
59
|
+
:flag => RequestBits.keys.inject(0) {|sum,k| sum | RequestBits[k][:flag]},
|
60
60
|
:desc => %Q[Requests all known columns from the API]
|
61
61
|
}
|
62
62
|
|
63
63
|
ResponseFlags = {
|
64
64
|
:alt_text => {
|
65
65
|
:name => 'Alt Text',
|
66
|
-
:flag => 1
|
66
|
+
:flag => 2**0, # 1
|
67
67
|
:desc => %Q[The anchor text is from the alt text of an image]
|
68
68
|
},
|
69
69
|
}
|
@@ -5,90 +5,90 @@ module Linkscape
|
|
5
5
|
RequestBits = {
|
6
6
|
:flags => {
|
7
7
|
:name => 'Flags',
|
8
|
-
:flag => 2,
|
8
|
+
:flag => 2**1, # 2
|
9
9
|
:desc => %Q[A bit field indicating a variety of attributes which apply to this link.]
|
10
10
|
},
|
11
11
|
:text => {
|
12
12
|
:name => 'Anchor Text',
|
13
|
-
:flag => 4
|
13
|
+
:flag => 2**2, # 4
|
14
14
|
:desc => %Q[The anchor text of the link, including any markup (e.g. image tags with alt text).]
|
15
15
|
},
|
16
16
|
:mozrank => {
|
17
17
|
:name => 'mozRank Passed',
|
18
|
-
:flag => 16
|
18
|
+
:flag => 2**4, # 16
|
19
19
|
:desc => %Q[The amount of mozRank passed by the link. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
20
20
|
}
|
21
21
|
}
|
22
22
|
RequestBits[:all] = {
|
23
|
-
:name => 'All
|
24
|
-
:flag => RequestBits.keys.inject(0) {|sum,k| sum
|
23
|
+
:name => 'All columns',
|
24
|
+
:flag => RequestBits.keys.inject(0) {|sum,k| sum | RequestBits[k][:flag]},
|
25
25
|
:desc => %Q[Requests all known columns from the API]
|
26
26
|
}
|
27
27
|
|
28
28
|
ResponseFlags = {
|
29
29
|
:no_follow => {
|
30
30
|
:name => 'No Follow',
|
31
|
-
:flag => 1
|
31
|
+
:flag => 2**0, # 1
|
32
32
|
:desc => %Q[The link in question bore a "rel=nofollow" directive indicating that no juice should flow over the link.]
|
33
33
|
},
|
34
34
|
:same_subdomain => {
|
35
35
|
:name => 'Same Subdomain',
|
36
|
-
:flag => 2,
|
36
|
+
:flag => 2**1, # 2
|
37
37
|
:desc => %Q[The link is between two pages on the same domain. This is an internal link.]
|
38
38
|
},
|
39
39
|
:meta_refresh => {
|
40
40
|
:name => 'Meta Refresh',
|
41
|
-
:flag => 4
|
41
|
+
:flag => 2**2, # 4
|
42
42
|
:desc => %Q[The link is actually a meta refresh from the source page to the target.]
|
43
43
|
},
|
44
44
|
:same_ip_address => {
|
45
45
|
:name => 'Same IP Address',
|
46
|
-
:flag => 8
|
46
|
+
:flag => 2**3, # 8
|
47
47
|
:desc => %Q[The link is between two pages hosted on the same IP address, strongly indicating a potential administrative relationship between the two.]
|
48
48
|
},
|
49
49
|
:same_c_block => {
|
50
50
|
:name => 'Same C-Block',
|
51
|
-
:flag => 16
|
51
|
+
:flag => 2**4, # 16
|
52
52
|
:desc => %Q[The link is between two pages hosted on the same C Block of IP addresses, indicating a potential administrative relationship between the two.]
|
53
53
|
},
|
54
54
|
:redirect301 => {
|
55
55
|
:name => '301',
|
56
|
-
:flag => 64
|
56
|
+
:flag => 2**6, # 64
|
57
57
|
:desc => %Q[The link is a 301 redirect. The source page returned a 301 redirect to our crawler, indicating that the resource was available on the target.]
|
58
58
|
},
|
59
59
|
:redirect302 => {
|
60
60
|
:name => '302',
|
61
|
-
:flag => 128
|
61
|
+
:flag => 2**7, # 128
|
62
62
|
:desc => %Q[The link is a 302 redirect. The source page returned a 302 redirect to our crawler, indicating that the resource was temporarily available on the target.]
|
63
63
|
},
|
64
64
|
:no_script => {
|
65
65
|
:name => 'No Script',
|
66
|
-
:flag => 256
|
66
|
+
:flag => 2**8, # 256
|
67
67
|
:desc => %Q[The link was located within a noscript html block. This means the link may not have been visible to users using javascript.]
|
68
68
|
},
|
69
69
|
:off_screen => {
|
70
70
|
:name => 'Off Screen',
|
71
|
-
:flag => 512
|
71
|
+
:flag => 2**9, # 512
|
72
72
|
:desc => %Q[We determined that the link likely appears offscreen. This means that the link may not have been visible to most users.]
|
73
73
|
},
|
74
74
|
:meta_no_follow => {
|
75
75
|
:name => 'Meta No Follow',
|
76
|
-
:flag => 2048
|
76
|
+
:flag => 2**11, # 2048
|
77
77
|
:desc => %Q[The link appeared on a page using a page level (meta) no follow directive. This link passes no juice.]
|
78
78
|
},
|
79
79
|
:same_root_domain => {
|
80
80
|
:name => 'Same Root Domain',
|
81
|
-
:flag => 4096
|
81
|
+
:flag => 2**12, # 4096
|
82
82
|
:desc => %Q[The link is between two pages on the same root domain. The link is not internal, but this strongly indicates an administrative relationship between the two pages.]
|
83
83
|
},
|
84
84
|
:feed_autodiscovery => {
|
85
85
|
:name => 'Feed Autodiscovery',
|
86
|
-
:flag => 16384
|
86
|
+
:flag => 2**14, # 16384
|
87
87
|
:desc => %Q[The link indicates a syndication feed (e.g. rss or atom) for the source page.]
|
88
88
|
},
|
89
89
|
:rel_canonical => {
|
90
90
|
:name => 'Rel Canonical',
|
91
|
-
:flag => 32768
|
91
|
+
:flag => 2**15, # 32768
|
92
92
|
:desc => %Q[The link indicates a canonical form of the page using the rel=canonical directive]
|
93
93
|
}
|
94
94
|
}
|
@@ -5,176 +5,346 @@ module Linkscape
|
|
5
5
|
RequestBits = {
|
6
6
|
:title => {
|
7
7
|
:name => 'Title',
|
8
|
-
:flag => 1
|
8
|
+
:flag => 2**0, # 1
|
9
9
|
:desc => %Q[The title of the page if available. For example: "Request-Response Format"]
|
10
10
|
},
|
11
11
|
:url => {
|
12
12
|
:name => 'URL',
|
13
|
-
:flag => 4
|
13
|
+
:flag => 2**2, # 4
|
14
14
|
:desc => %Q[The url of the page. For example: "apiwiki.seomoz.org/Request-Response+Format"]
|
15
15
|
},
|
16
16
|
:fq_domain => {
|
17
17
|
:name => 'Subdomain',
|
18
|
-
:flag => 8
|
18
|
+
:flag => 2**3, # 8
|
19
19
|
:desc => %Q[The subdomain of the url. For example: "apiwiki.seomoz.org"]
|
20
20
|
},
|
21
21
|
:pl_domain => {
|
22
22
|
:name => 'Root Domain',
|
23
|
-
:flag => 16
|
23
|
+
:flag => 2**4, # 16
|
24
24
|
:desc => %Q[The root domain of the url. For example: "seomoz.org"]
|
25
25
|
},
|
26
26
|
:external_links => {
|
27
27
|
:name => 'External Links',
|
28
|
-
:flag => 32
|
28
|
+
:flag => 2**5, # 32
|
29
29
|
:desc => %Q[The number of juice-passing external links to the url.]
|
30
30
|
},
|
31
31
|
:fq_domain_external_links => {
|
32
32
|
:name => 'Subdomain External Links',
|
33
|
-
:flag => 64
|
33
|
+
:flag => 2**6, # 64
|
34
34
|
:desc => %Q[The number of juice-passing external links to the subdomain of the url.]
|
35
35
|
},
|
36
36
|
:pl_domain_external_links => {
|
37
37
|
:name => 'Root Domain External Links',
|
38
|
-
:flag => 128
|
38
|
+
:flag => 2**7, # 128
|
39
39
|
:desc => %Q[The number of juice-passing external links to the root domain of the url.]
|
40
40
|
},
|
41
41
|
:juice_links => {
|
42
42
|
:name => 'Juice-Passing Links',
|
43
|
-
:flag => 256
|
43
|
+
:flag => 2**8, # 256
|
44
44
|
:desc => %Q[The number of juice-passing links (internal or external) to the url.]
|
45
45
|
},
|
46
46
|
:fq_domains_linking => {
|
47
47
|
:name => 'Subdomains Linking',
|
48
|
-
:flag => 512
|
48
|
+
:flag => 2**9, # 512
|
49
49
|
:desc => %Q[The number of subdomains with any pages linking to the url.]
|
50
50
|
},
|
51
51
|
:pl_domains_linking => {
|
52
52
|
:name => 'Root Domains Linking',
|
53
|
-
:flag => 1024
|
53
|
+
:flag => 2**10, # 1024
|
54
54
|
:desc => %Q[The number of root domains with any pages linking to the url.]
|
55
55
|
},
|
56
56
|
:links => {
|
57
57
|
:name => 'Links',
|
58
|
-
:flag => 2048
|
58
|
+
:flag => 2**11, # 2048
|
59
59
|
:desc => %Q[The number of links (juice-passing or not, internal or external) to the url.]
|
60
60
|
},
|
61
61
|
:fq_domain_links => {
|
62
62
|
:name => 'Subdomain Links',
|
63
|
-
:flag => 4294967296
|
63
|
+
:flag => 2**32, # 4294967296
|
64
64
|
:desc => %Q[The number of links to any page on the subdomain of the url.]
|
65
65
|
},
|
66
66
|
:fq_domain_fq_domains_linking => {
|
67
67
|
:name => 'Subdomain Subdomains Linking',
|
68
|
-
:flag => 4096
|
68
|
+
:flag => 2**12, # 4096
|
69
69
|
:desc => %Q[The number of subdomains with any pages linking to the subdomain of the url.]
|
70
70
|
},
|
71
71
|
:fq_domain_pl_domains_linking => {
|
72
72
|
:name => 'Subdomain Root Domains Linking',
|
73
|
-
:flag => 17179869184
|
73
|
+
:flag => 2**34, # 17179869184
|
74
74
|
:desc => %Q[The number of domains with any pages linking to the subdomain of the url.]
|
75
75
|
},
|
76
76
|
:pl_domain_links => {
|
77
77
|
:name => 'Root Domain Links',
|
78
|
-
:flag => 8589934592
|
78
|
+
:flag => 2**33, # 8589934592
|
79
79
|
:desc => %Q[The number of links to any page on the root domain of the url.]
|
80
80
|
},
|
81
81
|
:pl_domain_pl_domains_linking => {
|
82
82
|
:name => 'Root Domain Root Domains Linking',
|
83
|
-
:flag => 8192
|
83
|
+
:flag => 2**13, # 8192
|
84
84
|
:desc => %Q[The number of root domains with any pages linking to the root domain of the url.]
|
85
85
|
},
|
86
86
|
:mozrank => {
|
87
87
|
:name => 'mozRank',
|
88
|
-
:flag => 16384
|
88
|
+
:flag => 2**14, # 16384
|
89
89
|
:desc => %Q[The mozRank of the url. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
90
90
|
},
|
91
91
|
:fq_domain_mozrank => {
|
92
92
|
:name => 'Subdomain mozRank',
|
93
|
-
:flag => 32768
|
93
|
+
:flag => 2**15, # 32768
|
94
94
|
:desc => %Q[The mozRank of the subdomain of the url. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
95
95
|
},
|
96
96
|
:pl_domain_mozrank => {
|
97
97
|
:name => 'Root Domain mozRank',
|
98
|
-
:flag => 65536
|
98
|
+
:flag => 2**16, # 65536
|
99
99
|
:desc => %Q[The mozRank of the Root Domain of the url. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
100
100
|
},
|
101
101
|
:moztrust => {
|
102
102
|
:name => 'mozTrust',
|
103
|
-
:flag => 131072
|
103
|
+
:flag => 2**17, # 131072
|
104
104
|
:desc => %Q[The mozTrust of the url. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
105
105
|
},
|
106
106
|
:fq_domain_moztrust => {
|
107
107
|
:name => 'Subdomain mozTrust',
|
108
|
-
:flag => 262144
|
108
|
+
:flag => 2**18, # 262144
|
109
109
|
:desc => %Q[The mozTrust of the subdomain of the url. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
110
110
|
},
|
111
111
|
:pl_domain_moztrust => {
|
112
112
|
:name => 'Root Domain mozTrust',
|
113
|
-
:flag => 524288
|
113
|
+
:flag => 2**19, # 524288
|
114
114
|
:desc => %Q[The mozTrust of the root domain of the url. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
115
115
|
},
|
116
116
|
:external_mozrank => {
|
117
117
|
:name => 'External mozRank',
|
118
|
-
:flag => 1048576
|
118
|
+
:flag => 2**20, # 1048576
|
119
119
|
:desc => %Q[The portion of the url's mozRank coming from external links. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
120
120
|
},
|
121
121
|
:fq_domain_external_mozrank_sum_raw => {
|
122
122
|
:name => 'Subdomain External Domain Juice',
|
123
|
-
:flag => 2097152
|
123
|
+
:flag => 2**21, # 2097152
|
124
124
|
:desc => %Q[The portion of the mozRank of all pages on the subdomain coming from external links. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
125
125
|
},
|
126
126
|
:pl_domain_external_mozrank_sum_raw => {
|
127
127
|
:name => 'Root Domain External Domain Juice',
|
128
|
-
:flag => 4194304
|
128
|
+
:flag => 2**22, # 4194304
|
129
129
|
:desc => %Q[The portion of the mozRank of all pages on the root domain coming from external links. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
130
|
-
# source.External mozRank sum of all PL Domain Pages (raw) - 9.8334596959365e-11
|
131
130
|
},
|
132
131
|
:fq_domain_mozrank_sum_raw => {
|
133
132
|
:name => 'Subdomain Domain Juice',
|
134
|
-
:flag => 8388608
|
133
|
+
:flag => 2**23, # 8388608
|
135
134
|
:desc => %Q[The mozRank of all pages on the subdomain combined. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
136
135
|
},
|
137
136
|
:pl_domain_mozrank_sum_raw => {
|
138
137
|
:name => 'Root Domain Domain Juice',
|
139
|
-
:flag => 16777216
|
138
|
+
:flag => 2**24, # 16777216
|
140
139
|
:desc => %Q[The mozRank of all pages on the root domain combined. Requesting this metric will provide both the pretty 10-point score and the raw score.]
|
141
140
|
},
|
142
141
|
:canonical_url => {
|
143
142
|
:name => 'Canonical URL',
|
144
|
-
:flag => 268435456
|
143
|
+
:flag => 2**28, # 268435456
|
145
144
|
:desc => %Q[If the url canaonicalizes to a different form, that canonical form will be available in this field]
|
146
145
|
},
|
147
146
|
:status => {
|
148
147
|
:name => 'HTTP Status Code',
|
149
|
-
:flag => 536870912
|
148
|
+
:flag => 2**29, # 536870912
|
150
149
|
:desc => %Q[The HTTP status code recorded by Linkscape for this URL (if available)]
|
151
150
|
},
|
152
151
|
|
153
152
|
:page_authority => {
|
154
153
|
:name => 'Page Authority',
|
155
|
-
:flag => 34359738368
|
154
|
+
:flag => 2**35, # 34359738368
|
156
155
|
:desc => %Q[The page authority of this URL. This will return the pretty 100-point score.]
|
157
156
|
},
|
158
157
|
:domain_authority => {
|
159
158
|
:name => 'Domain Authority',
|
160
|
-
:flag => 68719476736
|
159
|
+
:flag => 2**36, # 68719476736
|
161
160
|
:desc => %Q[The page authority of all pages on the root domain. This will return the pretty 100-point score.]
|
162
161
|
},
|
162
|
+
|
163
|
+
:all_external_links => {
|
164
|
+
:name => 'All external links page to page',
|
165
|
+
:flag => 2**39,
|
166
|
+
:desc => %Q[The number of external links from one page to another (included followed and nofollowed).]
|
167
|
+
},
|
168
|
+
:juice_fq_domains_linking => {
|
169
|
+
:name => 'Followed Domains Linking Page',
|
170
|
+
:flag => 2**40,
|
171
|
+
:desc => %Q[The number of unique domains with followed links to the target url.]
|
172
|
+
},
|
173
|
+
:juice_ips_linking => {
|
174
|
+
:name => 'Followed IPs Linking',
|
175
|
+
:flag => 2**41,
|
176
|
+
:desc => %Q[The number unique IPs with a followable link to a target url.]
|
177
|
+
},
|
178
|
+
:ips_linking => {
|
179
|
+
:name => 'IPs Linking',
|
180
|
+
:flag => 2**42,
|
181
|
+
:desc => %Q[The total number of unique IPs linking to a target url.]
|
182
|
+
},
|
183
|
+
:juice_pl_domains_linking => {
|
184
|
+
:name => 'Followed Domains to Page',
|
185
|
+
:flag => 2**43,
|
186
|
+
:desc => %Q[The number of unique domains with followed links to a given url.]
|
187
|
+
},
|
188
|
+
:cblocks_linking => {
|
189
|
+
:name => 'All Cblock Linking',
|
190
|
+
:flag => 2**44,
|
191
|
+
:desc => %Q[The total number unique cblocks linking to a page.]
|
192
|
+
},
|
193
|
+
:juice_cblocks_linking => {
|
194
|
+
:name => 'Followed CBLocks Linking',
|
195
|
+
:flag => 2**45,
|
196
|
+
:desc => %Q[The total number unique cblocks with followed links to a page.]
|
197
|
+
},
|
198
|
+
:fq_domain_juice_links => {
|
199
|
+
:name => 'Followed Subdomain Linking Domains',
|
200
|
+
:flag => 2**46,
|
201
|
+
:desc => %Q[A count of all unique subdomains with followed links to the target domain.]
|
202
|
+
},
|
203
|
+
:fq_domain_all_external_links => {
|
204
|
+
:name => 'Subdomain External Links',
|
205
|
+
:flag => 2**47,
|
206
|
+
:desc => %Q[The total number (followed and nofollowed) external links to the subdomain of the url.]
|
207
|
+
},
|
208
|
+
:fq_domain_juice_fq_domains_linking => {
|
209
|
+
:name => 'Followed Subdomain Subdomains Links',
|
210
|
+
:flag => 2**48,
|
211
|
+
:desc => %Q[The number of subdomains with followed links to the subdomain of the url.]
|
212
|
+
},
|
213
|
+
:fq_domain_juice_pl_domains_linking => {
|
214
|
+
:name => 'Followed Domain Subdomains Links',
|
215
|
+
:flag => 2**49,
|
216
|
+
:desc => %Q[The number of unique domains with followed links to the subdomain of the url.]
|
217
|
+
},
|
218
|
+
:pl_domain_juice_links => {
|
219
|
+
:name => 'Followed Root Domain Links',
|
220
|
+
:flag => 2**50,
|
221
|
+
:desc => %Q[The total number of followed links (both internal and external) from a page to a domain.]
|
222
|
+
},
|
223
|
+
:pl_domain_all_external_links => {
|
224
|
+
:name => 'All Root Domain External Links',
|
225
|
+
:flag => 2**51,
|
226
|
+
:desc => %Q[The total number of external links (both followed and no-followed) from a page to a domain.]
|
227
|
+
},
|
228
|
+
:pl_domain_juice_pl_domains_linking => {
|
229
|
+
:name => 'All Followed Root Domains Linking Domain',
|
230
|
+
:flag => 2**52,
|
231
|
+
:desc => %Q[The total number of followed root domains linking to the target's domain.]
|
232
|
+
},
|
233
|
+
:pl_domain_ips_linking => {
|
234
|
+
:name => 'IPs Linking to Domain',
|
235
|
+
:flag => 2**53,
|
236
|
+
:desc => %Q[The total number of unique IPs linking to the target's domain.]
|
237
|
+
},
|
238
|
+
:pl_domain_juice_ips_linking => {
|
239
|
+
:name => 'Followed IPs Linking to Domain',
|
240
|
+
:flag => 2**54,
|
241
|
+
:desc => %Q[The total number of unique IPs with followed links to the target's domain.]
|
242
|
+
},
|
243
|
+
:pl_domain_cblocks_linking => {
|
244
|
+
:name => 'All Cblock Linking Domain',
|
245
|
+
:flag => 2**55,
|
246
|
+
:desc => %Q[The number of unique cblocks with a link to a domain.]
|
247
|
+
},
|
248
|
+
:pl_domain_juice_cblocks_linking => {
|
249
|
+
:name => 'Followed Cblock Linking Domain',
|
250
|
+
:flag => 2**56,
|
251
|
+
:desc => %Q[The total number of cblock with followed links to a domain.]
|
252
|
+
},
|
253
|
+
|
163
254
|
:page_authority_raw => {
|
164
255
|
:name => 'Raw Page Authority',
|
165
|
-
:flag => 137438953472
|
256
|
+
:flag => 2**37, # 137438953472
|
166
257
|
:desc => %Q[The page authority of this URL. This will return the raw score.]
|
167
258
|
},
|
168
259
|
:domain_authority_raw => {
|
169
260
|
:name => 'Raw Domain Authority',
|
170
|
-
:flag => 274877906944
|
261
|
+
:flag => 2**38, # 274877906944
|
171
262
|
:desc => %Q[The page authority of all pages on the root domain. This will return the raw score.]
|
172
263
|
},
|
264
|
+
|
265
|
+
# The following are calculated values. If you ask for them,
|
266
|
+
# we'll convert it into a request for the fields they
|
267
|
+
# depend on. In the Response, we'll then set the key from
|
268
|
+
# those values.
|
269
|
+
:unfollowed_external_links => {
|
270
|
+
:flag => 2**39 | 2**5,
|
271
|
+
},
|
272
|
+
:unfollowed_links => {
|
273
|
+
:flag => 2**11 | 2**8,
|
274
|
+
},
|
275
|
+
:juice_internal_links => {
|
276
|
+
:flag => 2**8 | 2**5,
|
277
|
+
},
|
278
|
+
:internal_links => {
|
279
|
+
:flag => 2**11 | 2**39,
|
280
|
+
},
|
281
|
+
:unfollowed_internal_links => {
|
282
|
+
:flag => 2**11 | 2**39 | 2**8 | 2**5,
|
283
|
+
},
|
284
|
+
:fq_domain_unfollowed_external_links => {
|
285
|
+
:flag => 2**47 | 2**6,
|
286
|
+
},
|
287
|
+
:fq_domain_unfollowed_links => {
|
288
|
+
:flag => 2**32 | 2**46,
|
289
|
+
},
|
290
|
+
:fq_domain_juice_internal_links => {
|
291
|
+
:flag => 2**46 | 2**6,
|
292
|
+
},
|
293
|
+
:fq_domain_internal_links => {
|
294
|
+
:flag => 2**32 | 2**47,
|
295
|
+
},
|
296
|
+
:fq_domain_unfollowed_internal_links => {
|
297
|
+
:flag => 2**32 | 2**47 | 2**46 | 2**6,
|
298
|
+
},
|
299
|
+
:pl_domain_unfollowed_external_links => {
|
300
|
+
:flag => 2**51 | 2**7,
|
301
|
+
},
|
302
|
+
:pl_domain_unfollowed_links => {
|
303
|
+
:flag => 2**33 | 2**50,
|
304
|
+
},
|
305
|
+
:pl_domain_juice_internal_links => {
|
306
|
+
:flag => 2**50 | 2**7,
|
307
|
+
},
|
308
|
+
:pl_domain_internal_links => {
|
309
|
+
:flag => 2**33 | 2**51,
|
310
|
+
},
|
311
|
+
:pl_domain_unfollowed_internal_links => {
|
312
|
+
:flag => 2**33 | 2**51 | 2**50 | 2**7,
|
313
|
+
},
|
314
|
+
:unfollowed_fq_domains_linking => {
|
315
|
+
:flag => 2**9 | 2**40,
|
316
|
+
},
|
317
|
+
:unfollowed_pl_domains_linking => {
|
318
|
+
:flag => 2**10 | 2**43,
|
319
|
+
},
|
320
|
+
:fq_domain_unfollowed_fq_domains_linking => {
|
321
|
+
:flag => 2**12 | 2**48,
|
322
|
+
},
|
323
|
+
:pl_domain_unfollowed_pl_domains_linking => {
|
324
|
+
:flag => 2**13 | 2**52,
|
325
|
+
},
|
326
|
+
:fq_domain_unfollowed_pl_domains_linking => {
|
327
|
+
:flag => 2**34 | 2**49,
|
328
|
+
},
|
329
|
+
:unfollowed_ips_linking => {
|
330
|
+
:flag => 2**42 | 2**41,
|
331
|
+
},
|
332
|
+
:unfollowed_cblocks_linking => {
|
333
|
+
:flag => 2**44 | 2**45,
|
334
|
+
},
|
335
|
+
:pl_domain_unfollowed_cblocks_linking => {
|
336
|
+
:flag => 2**55 | 2**56,
|
337
|
+
},
|
338
|
+
:pl_domain_unfollowed_ips_linking => {
|
339
|
+
:flag => 2**53 | 2**54,
|
340
|
+
},
|
341
|
+
|
342
|
+
|
173
343
|
|
174
344
|
}
|
175
345
|
RequestBits[:all] = {
|
176
|
-
:name => 'All
|
177
|
-
:flag => RequestBits.keys.inject(0) {|sum,k| sum
|
346
|
+
:name => 'All columns',
|
347
|
+
:flag => RequestBits.keys.inject(0) {|sum,k| sum | RequestBits[k][:flag]},
|
178
348
|
:desc => %Q[Requests all known columns from the API]
|
179
349
|
}
|
180
350
|
|
data/lib/linkscape/response.rb
CHANGED
@@ -32,9 +32,18 @@ module Linkscape
|
|
32
32
|
elsif Array === @data
|
33
33
|
:array
|
34
34
|
end
|
35
|
+
|
35
36
|
@data.symbolize_keys! if Hash === @data
|
36
37
|
@data = @data.collect{|d|ResponseData.new(d)} if Array === @data
|
37
38
|
|
39
|
+
if Hash === @data && !type.nil?
|
40
|
+
Linkscape::Constants::CalculationKeyMap.each do |key, keys|
|
41
|
+
unless @data[keys[0]].nil? or @data[keys[1]].nil?
|
42
|
+
@data[key] = @data[keys[0]] - @data[keys[1]]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
38
47
|
if @type == :hash
|
39
48
|
subdatas = {}
|
40
49
|
@data.each do |k,v|
|
@@ -75,11 +84,7 @@ module Linkscape
|
|
75
84
|
printer = Proc.new do |h,prefix|
|
76
85
|
o = ""
|
77
86
|
h.sort{|l,r|l[0].to_s<=>r[0].to_s}.each do |k,v|
|
78
|
-
field = Linkscape::Constants::ResponseFields[k]
|
79
87
|
v = v.to_s
|
80
|
-
# v = ((field && field[:bitfield]) ? v.to_a.inspect : v).to_s
|
81
|
-
#desc = field ? field[:name] : '*'+k.inspect
|
82
|
-
#o += %Q[%s%-#{Linkscape::Constants::LongestNameLength+15}.#{Linkscape::Constants::LongestNameLength+15}s - %s\n] % [prefix, desc, v]
|
83
88
|
o += %Q[%s%-#{Linkscape::Constants::LongestKeyLength+5}.#{Linkscape::Constants::LongestKeyLength+5}s - %s\n] % [prefix, k, v]
|
84
89
|
end
|
85
90
|
o
|
data/linkscape.gemspec
CHANGED
@@ -1,54 +1,52 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{linkscape}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["
|
12
|
-
s.date = %q{2010-
|
11
|
+
s.authors = ["Martin Tithonium", "Jeff Pollard", "Bryce Howard"]
|
12
|
+
s.date = %q{2010-12-17}
|
13
13
|
s.description = %q{Provides an interface to SEOmoz's suite of APIs, including the free and site intelligence APIs.}
|
14
14
|
s.email = %q{api@seomoz.org}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
"test.rb"
|
20
|
+
"LICENSE",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"lib/hash-ext.rb",
|
25
|
+
"lib/linkscape.rb",
|
26
|
+
"lib/linkscape/client.rb",
|
27
|
+
"lib/linkscape/constants.rb",
|
28
|
+
"lib/linkscape/constants/anchor-metrics.rb",
|
29
|
+
"lib/linkscape/constants/link-metrics.rb",
|
30
|
+
"lib/linkscape/constants/url-metrics.rb",
|
31
|
+
"lib/linkscape/errors.rb",
|
32
|
+
"lib/linkscape/request.rb",
|
33
|
+
"lib/linkscape/response.rb",
|
34
|
+
"lib/linkscape/signer.rb",
|
35
|
+
"lib/string-ext.rb",
|
36
|
+
"linkscape.gemspec",
|
37
|
+
"rails/init.rb",
|
38
|
+
"test.rb"
|
40
39
|
]
|
41
40
|
s.homepage = %q{http://github.com/seomoz/linkscape-gem}
|
42
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
43
41
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.
|
42
|
+
s.rubygems_version = %q{1.3.7}
|
45
43
|
s.summary = %q{Provides an interface to the SEOmoz API}
|
46
44
|
|
47
45
|
if s.respond_to? :specification_version then
|
48
46
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
49
47
|
s.specification_version = 3
|
50
48
|
|
51
|
-
if Gem::Version.new(Gem::
|
49
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
50
|
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0"])
|
53
51
|
else
|
54
52
|
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
metadata
CHANGED
@@ -1,30 +1,34 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkscape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 0.3.0
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
|
-
-
|
13
|
+
- Martin Tithonium
|
13
14
|
- Jeff Pollard
|
15
|
+
- Bryce Howard
|
14
16
|
autorequire:
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2010-
|
20
|
+
date: 2010-12-17 00:00:00 -08:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
22
24
|
name: ruby-hmac
|
23
25
|
prerelease: false
|
24
26
|
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
29
|
- - ">="
|
27
30
|
- !ruby/object:Gem::Version
|
31
|
+
hash: 3
|
28
32
|
segments:
|
29
33
|
- 0
|
30
34
|
version: "0"
|
@@ -40,7 +44,6 @@ extra_rdoc_files:
|
|
40
44
|
- LICENSE
|
41
45
|
- README.rdoc
|
42
46
|
files:
|
43
|
-
- .gitignore
|
44
47
|
- LICENSE
|
45
48
|
- README.rdoc
|
46
49
|
- Rakefile
|
@@ -65,28 +68,32 @@ homepage: http://github.com/seomoz/linkscape-gem
|
|
65
68
|
licenses: []
|
66
69
|
|
67
70
|
post_install_message:
|
68
|
-
rdoc_options:
|
69
|
-
|
71
|
+
rdoc_options: []
|
72
|
+
|
70
73
|
require_paths:
|
71
74
|
- lib
|
72
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
73
77
|
requirements:
|
74
78
|
- - ">="
|
75
79
|
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
76
81
|
segments:
|
77
82
|
- 0
|
78
83
|
version: "0"
|
79
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
80
86
|
requirements:
|
81
87
|
- - ">="
|
82
88
|
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
83
90
|
segments:
|
84
91
|
- 0
|
85
92
|
version: "0"
|
86
93
|
requirements: []
|
87
94
|
|
88
95
|
rubyforge_project:
|
89
|
-
rubygems_version: 1.3.
|
96
|
+
rubygems_version: 1.3.7
|
90
97
|
signing_key:
|
91
98
|
specification_version: 3
|
92
99
|
summary: Provides an interface to the SEOmoz API
|