alexa 0.4.1 → 0.4.2
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 +7 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -1
- data/README.md +2 -0
- data/alexa.gemspec +1 -0
- data/lib/alexa/api/url_info.rb +5 -1
- data/lib/alexa/version.rb +1 -1
- data/test/api/url_info_test.rb +4 -0
- data/test/fixtures/url_info/github_full.txt +16 -6
- metadata +15 -28
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d02a9a60ebe87c024c69cdf095863a8fc1974c49
|
4
|
+
data.tar.gz: 42561bde897223aac092cf285de973b883537e6f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aa11e56dff3260c2b199a801898de885557181dc4ba75b476d44abada64ae76a04a45164fdaed10b830d2b188d39e8936f70553de35d235cb73bdc36f0849fd2
|
7
|
+
data.tar.gz: d243187be9da286c3d5cab9c977b5de11acb9233e3128dec5d2de34789c2ec89f44056e93d2e3e3bad1c0945f0b2602064c639c8248666fae4332f721ed504d0
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -35,6 +35,7 @@ Returns object that contains methods:
|
|
35
35
|
* rank_by_country
|
36
36
|
* rank_by_city
|
37
37
|
* usage_statistics
|
38
|
+
* categories
|
38
39
|
|
39
40
|
You can specify options:
|
40
41
|
|
@@ -143,6 +144,7 @@ Currently alexa will not work with `ox` gem
|
|
143
144
|
## Contributors
|
144
145
|
|
145
146
|
* [rmoriz](https://github.com/rmoriz)
|
147
|
+
* [jasongill](https://github.com/jasongill)
|
146
148
|
|
147
149
|
## Continuous Integration
|
148
150
|
|
data/alexa.gemspec
CHANGED
@@ -7,6 +7,7 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.description = %q{Alexa Web Information Service library (AWIS)}
|
8
8
|
gem.summary = %q{Alexa Web Information Service library}
|
9
9
|
gem.homepage = "https://github.com/morgoth/alexa"
|
10
|
+
gem.license = "MIT"
|
10
11
|
|
11
12
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
13
|
gem.files = `git ls-files`.split("\n")
|
data/lib/alexa/api/url_info.rb
CHANGED
@@ -3,7 +3,7 @@ require "alexa/api/base"
|
|
3
3
|
module Alexa
|
4
4
|
module API
|
5
5
|
class UrlInfo < Base
|
6
|
-
DEFAULT_RESPONSE_GROUP = ["adult_content", "contact_info", "keywords", "language", "links_in_count", "owned_domains", "rank", "rank_by_city", "rank_by_country", "related_links", "site_data", "speed", "usage_stats"]
|
6
|
+
DEFAULT_RESPONSE_GROUP = ["adult_content", "contact_info", "keywords", "language", "links_in_count", "owned_domains", "rank", "rank_by_city", "rank_by_country", "related_links", "site_data", "speed", "usage_stats", "categories"]
|
7
7
|
|
8
8
|
def fetch(arguments = {})
|
9
9
|
raise ArgumentError, "You must specify url" unless arguments.has_key?(:url)
|
@@ -84,6 +84,10 @@ module Alexa
|
|
84
84
|
def related_links
|
85
85
|
@related_links ||= safe_retrieve(parsed_body, "UrlInfoResponse", "Response", "UrlInfoResult", "Alexa", "Related", "RelatedLinks", "RelatedLink")
|
86
86
|
end
|
87
|
+
|
88
|
+
def categories
|
89
|
+
@categories ||= safe_retrieve(parsed_body, "UrlInfoResponse", "Response", "UrlInfoResult", "Alexa", "Related", "Categories", "CategoryData")
|
90
|
+
end
|
87
91
|
|
88
92
|
def status_code
|
89
93
|
@status_code ||= safe_retrieve(parsed_body, "UrlInfoResponse", "Response", "ResponseStatus", "StatusCode")
|
data/lib/alexa/version.rb
CHANGED
data/test/api/url_info_test.rb
CHANGED
@@ -108,6 +108,10 @@ describe Alexa::API::UrlInfo do
|
|
108
108
|
it "returns usage statistics" do
|
109
109
|
assert_equal 4, @url_info.usage_statistics.size
|
110
110
|
end
|
111
|
+
|
112
|
+
it "returns categories" do
|
113
|
+
assert_equal 2, @url_info.categories.size
|
114
|
+
end
|
111
115
|
|
112
116
|
it "has success status code" do
|
113
117
|
assert_equal "Success", @url_info.status_code
|
@@ -1,9 +1,9 @@
|
|
1
|
-
HTTP/1.1 200 OK
|
2
|
-
Server: Apache-Coyote/1.1
|
3
|
-
Content-Type: text/xml
|
4
|
-
Transfer-Encoding: chunked
|
5
|
-
Date: Wed, 12 Oct 2011 16:41:16 GMT
|
6
|
-
|
1
|
+
HTTP/1.1 200 OK
|
2
|
+
Server: Apache-Coyote/1.1
|
3
|
+
Content-Type: text/xml
|
4
|
+
Transfer-Encoding: chunked
|
5
|
+
Date: Wed, 12 Oct 2011 16:41:16 GMT
|
6
|
+
|
7
7
|
<?xml version="1.0"?>
|
8
8
|
<aws:UrlInfoResponse xmlns:aws="http://alexa.amazonaws.com/doc/2005-07-11/"><aws:Response xmlns:aws="http://awis.amazonaws.com/doc/2005-07-11"><aws:OperationRequest><aws:RequestId>7afc354d-4e20-cee1-a956-632f1edeefed</aws:RequestId></aws:OperationRequest><aws:UrlInfoResult><aws:Alexa>
|
9
9
|
|
@@ -87,6 +87,16 @@ Date: Wed, 12 Oct 2011 16:41:16 GMT
|
|
87
87
|
<aws:Title>Agile Web Development</aws:Title>
|
88
88
|
</aws:RelatedLink>
|
89
89
|
</aws:RelatedLinks>
|
90
|
+
<aws:Categories>
|
91
|
+
<aws:CategoryData>
|
92
|
+
<aws:Title>Open Source/Project Hosting</aws:Title>
|
93
|
+
<aws:AbsolutePath>Top/Computers/Open_Source/Project_Hosting</aws:AbsolutePath>
|
94
|
+
</aws:CategoryData>
|
95
|
+
<aws:CategoryData>
|
96
|
+
<aws:Title>Tools/Git</aws:Title>
|
97
|
+
<aws:AbsolutePath>Top/Computers/Software/Configuration_Management/Tools/Git</aws:AbsolutePath>
|
98
|
+
</aws:CategoryData>
|
99
|
+
</aws:Categories>
|
90
100
|
</aws:Related>
|
91
101
|
<aws:TrafficData>
|
92
102
|
<aws:DataUrl type="canonical">github.com</aws:DataUrl>
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Wojciech Wnętrzak
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: multi_xml
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 0.5.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 0.5.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: mocha
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: webmock
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Alexa Web Information Service library (AWIS)
|
@@ -107,33 +100,27 @@ files:
|
|
107
100
|
- test/helper.rb
|
108
101
|
- test/utils_test.rb
|
109
102
|
homepage: https://github.com/morgoth/alexa
|
110
|
-
licenses:
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
111
106
|
post_install_message:
|
112
107
|
rdoc_options: []
|
113
108
|
require_paths:
|
114
109
|
- lib
|
115
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
-
none: false
|
117
111
|
requirements:
|
118
|
-
- -
|
112
|
+
- - '>='
|
119
113
|
- !ruby/object:Gem::Version
|
120
114
|
version: '0'
|
121
|
-
segments:
|
122
|
-
- 0
|
123
|
-
hash: -175451071600654437
|
124
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
116
|
requirements:
|
127
|
-
- -
|
117
|
+
- - '>='
|
128
118
|
- !ruby/object:Gem::Version
|
129
119
|
version: '0'
|
130
|
-
segments:
|
131
|
-
- 0
|
132
|
-
hash: -175451071600654437
|
133
120
|
requirements: []
|
134
121
|
rubyforge_project:
|
135
|
-
rubygems_version:
|
122
|
+
rubygems_version: 2.0.2
|
136
123
|
signing_key:
|
137
|
-
specification_version:
|
124
|
+
specification_version: 4
|
138
125
|
summary: Alexa Web Information Service library
|
139
126
|
test_files: []
|