mozapi 0.1.4 → 0.1.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/lib/mozapi.rb +17 -5
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: af97d62322b00f22302b845b62a62b75d69de204
|
|
4
|
+
data.tar.gz: 91481d6cb26980676e656db11afb244a6e624d0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50afacdf0c475f370225b9e914fcc1e1f2f94cc4bfc3724696b203ff5d63710cc89e6ad912cb15ae968f08de97d96c56036d320987593f7d17602675f11a7361
|
|
7
|
+
data.tar.gz: 14c3562499d636c808f1bc0cc677e8032877894dfead95ef12f91170b72d3ebf0d026cd157cb7e9fc40d0c94c273720eb949e3e5a84ef30a1b29a72def2d692d
|
data/lib/mozapi.rb
CHANGED
|
@@ -21,18 +21,30 @@ class MozAPI
|
|
|
21
21
|
|
|
22
22
|
LIMIT = 100
|
|
23
23
|
|
|
24
|
+
# defined
|
|
25
|
+
|
|
26
|
+
|
|
24
27
|
URL = 4
|
|
25
28
|
ROOT_DOMAIN = 16
|
|
29
|
+
# uipl - not in the free version
|
|
30
|
+
LINKING_ROOT_DOMAINS = 1024
|
|
31
|
+
# uid
|
|
32
|
+
LINKS = 2048
|
|
33
|
+
# upa
|
|
34
|
+
PAGE_AUTHORITY = 34359738368
|
|
35
|
+
# pda
|
|
26
36
|
DOMAIN_AUTHORITY = 68719476736
|
|
37
|
+
# pib
|
|
38
|
+
LINKING_C_BLOCKS = 36028797018963968
|
|
27
39
|
|
|
28
40
|
# URL + root_domain + page_authority + domain_authority
|
|
29
|
-
DEFAULT_SOURCE_COLS = URL + ROOT_DOMAIN +
|
|
41
|
+
DEFAULT_SOURCE_COLS = URL + ROOT_DOMAIN + PAGE_AUTHORITY + DOMAIN_AUTHORITY
|
|
30
42
|
# URL + root_domain
|
|
31
43
|
DEFAULT_TARGET_COLS = URL + ROOT_DOMAIN
|
|
32
44
|
# anchor_text
|
|
33
45
|
DEFAULT_LINK_COLS = URL
|
|
34
|
-
# linking root domains + links
|
|
35
|
-
DEFAULT_URL_METRICS_COLS =
|
|
46
|
+
# linking root domains + links + DA
|
|
47
|
+
DEFAULT_URL_METRICS_COLS = LINKING_ROOT_DOMAINS + 2048 + DOMAIN_AUTHORITY + LINKING_C_BLOCKS
|
|
36
48
|
|
|
37
49
|
|
|
38
50
|
def initialize
|
|
@@ -71,7 +83,7 @@ class MozAPI
|
|
|
71
83
|
end
|
|
72
84
|
|
|
73
85
|
#
|
|
74
|
-
def url_metrics(
|
|
86
|
+
def url_metrics(target_url, options = {})
|
|
75
87
|
sleep 10
|
|
76
88
|
|
|
77
89
|
expires = expiration_time
|
|
@@ -84,7 +96,7 @@ class MozAPI
|
|
|
84
96
|
}.merge(options)
|
|
85
97
|
|
|
86
98
|
#puts "[MozAPI#links] options: #{options[:Offset]}"
|
|
87
|
-
req_url = "http://lsapi.seomoz.com/linkscape/
|
|
99
|
+
req_url = "http://lsapi.seomoz.com/linkscape/url-metrics/#{URI::encode(target_url)}?#{options.to_query}"
|
|
88
100
|
|
|
89
101
|
response = HTTParty.get(req_url, :headers => {"User-Agent" => 'node-linkscape (https://github.com/mjp/node-linkscape)'})
|
|
90
102
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mozapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christoph Engelhardt
|
|
@@ -14,16 +14,16 @@ dependencies:
|
|
|
14
14
|
name: httparty
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 0.13.1
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 0.13.1
|
|
27
27
|
description: MozAPI is a light-weight wrapper for the MozscapeAPI (http://moz.com/products/api).
|
|
28
28
|
It currently supports parts of the 'links' endpoint
|
|
29
29
|
email: christoph@it-engelhardt.de
|