webmaster_tools 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.
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/check.rb +18 -0
- data/lib/webmaster_tools.rb +13 -6
- data/spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts.yml +4091 -5130
- data/spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts_splitted.yml +4083 -5121
- data/spec/fixtures/cassettes/WebmasterTools/_crawl_stats/gets_crawl_stats.yml +315 -342
- data/spec/fixtures/cassettes/WebmasterTools/_login/passes_with_correct_username_password.yml +243 -263
- data/spec/fixtures/cassettes/WebmasterTools/_security_token/gets_the_token.yml +2283 -0
- data/spec/fixtures/cassettes/WebmasterTools/_suggest_counts/gets_suggest_counts.yml +318 -347
- data/spec/fixtures/cassettes/WebmasterTools/amazon_url/_crawl_info/gets_crawl_info.yml +486 -905
- data/spec/fixtures/cassettes/WebmasterTools/amazon_url/_dashboard/gets_dashboard.yml +475 -894
- data/spec/fixtures/cassettes/WebmasterTools/amazon_url/_remove_url/refuses_url_and_throws_error.yml +296 -309
- data/spec/fixtures/cassettes/WebmasterTools/amazon_url/_remove_url/removes_url.yml +1012 -944
- data/spec/webmaster_tools_spec.rb +23 -14
- metadata +15 -12
@@ -1,11 +1,11 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
# require "debugger"
|
3
3
|
|
4
|
-
describe WebmasterTools do
|
4
|
+
describe WebmasterTools, :vcr do
|
5
5
|
let(:webmaster_tools) { WebmasterTools.new("sitemap-stats@testscloud.com", "12test34") }
|
6
6
|
let(:url) { "http://testscloud.com/" }
|
7
7
|
|
8
|
-
describe "#login"
|
8
|
+
describe "#login" do
|
9
9
|
it 'passes with correct username + password' do
|
10
10
|
expect do
|
11
11
|
webmaster_tools
|
@@ -19,25 +19,34 @@ describe WebmasterTools do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
describe "#crawl_stats"
|
22
|
+
describe "#crawl_stats" do
|
23
23
|
it 'gets crawl_stats' do
|
24
|
-
webmaster_tools.crawl_stats(url).should == {:pages=>{:high=>
|
24
|
+
webmaster_tools.crawl_stats(url).should == {:pages=>{:high=>3749227, :avg=>2011501, :low=>526983}, :kilobytes=>{:high=>56952037, :avg=>29845029, :low=>9783669}, :milliseconds=>{:high=>655, :avg=>424, :low=>254}}
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
describe "#suggest_counts"
|
28
|
+
describe "#suggest_counts" do
|
29
29
|
it 'gets suggest_counts' do
|
30
|
-
webmaster_tools.suggest_counts(url).should == {:duplicate_meta_descriptions=>
|
30
|
+
webmaster_tools.suggest_counts(url).should == {:duplicate_meta_descriptions=>8167515, :short_meta_descriptions=>3, :missing_title_tags=>3, :duplicate_title_tags=>981649}
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
describe "#crawl_error_counts"
|
34
|
+
describe "#crawl_error_counts" do
|
35
35
|
it 'gets crawl_error_counts' do
|
36
|
-
webmaster_tools.crawl_error_counts(url).should == {:access_denied=>
|
36
|
+
webmaster_tools.crawl_error_counts(url).should == {:access_denied=>311, :not_found=>2000, :other=>592, :server_error=>1011, :soft_404=>1}
|
37
37
|
end
|
38
38
|
|
39
39
|
it 'gets crawl_error_counts splitted' do
|
40
|
-
webmaster_tools.crawl_error_counts(url, true).to_a.last.should == ["2012-
|
40
|
+
webmaster_tools.crawl_error_counts(url, true).to_a.last.should == ["2012-05-31", {:not_found=>3}]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "#security_token" do
|
45
|
+
|
46
|
+
it "gets the token" do
|
47
|
+
expect do
|
48
|
+
webmaster_tools.send(:security_token, :info, url)
|
49
|
+
end.to_not raise_error
|
41
50
|
end
|
42
51
|
end
|
43
52
|
|
@@ -46,7 +55,7 @@ describe WebmasterTools do
|
|
46
55
|
context "amazon url" do
|
47
56
|
let(:url) { "http://testscloud-sitemaps.cloudservice-sitemap.hoostings.com/" }
|
48
57
|
|
49
|
-
describe "#dashboard"
|
58
|
+
describe "#dashboard" do
|
50
59
|
it 'gets dashboard' do
|
51
60
|
expect do
|
52
61
|
webmaster_tools.dashboard(url)
|
@@ -54,17 +63,17 @@ describe WebmasterTools do
|
|
54
63
|
end
|
55
64
|
end
|
56
65
|
|
57
|
-
describe "#crawl_info"
|
66
|
+
describe "#crawl_info" do
|
58
67
|
it 'gets crawl_info' do
|
59
|
-
webmaster_tools.crawl_info(url).first[:indexed_web].to_i.should ==
|
68
|
+
webmaster_tools.crawl_info(url).first[:indexed_web].to_i.should == 17182421
|
60
69
|
end
|
61
70
|
|
62
71
|
it 'gets crawl_info' do
|
63
|
-
webmaster_tools.crawl_info(url).last[:indexed_web].to_i.should ==
|
72
|
+
webmaster_tools.crawl_info(url).last[:indexed_web].to_i.should == 21833811
|
64
73
|
end
|
65
74
|
end
|
66
75
|
|
67
|
-
describe "#remove_url"
|
76
|
+
describe "#remove_url" do
|
68
77
|
it 'removes url' do
|
69
78
|
expect do
|
70
79
|
webmaster_tools.remove_url(url + "test2.html")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmaster_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-01 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mechanize
|
16
|
-
requirement: &
|
16
|
+
requirement: &70360700503140 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70360700503140
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70360700502560 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70360700502560
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70360700502100 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70360700502100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: vcr
|
49
|
-
requirement: &
|
49
|
+
requirement: &70360700501640 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70360700501640
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: webmock
|
60
|
-
requirement: &
|
60
|
+
requirement: &70360700501180 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70360700501180
|
69
69
|
description: Webmaster Tools extends the official API to give programmatically access
|
70
70
|
to various crawl information and functions which are available via the webinterface
|
71
71
|
email:
|
@@ -82,11 +82,13 @@ files:
|
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
84
|
- VERSION
|
85
|
+
- check.rb
|
85
86
|
- lib/webmaster_tools.rb
|
86
87
|
- spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts.yml
|
87
88
|
- spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts_splitted.yml
|
88
89
|
- spec/fixtures/cassettes/WebmasterTools/_crawl_stats/gets_crawl_stats.yml
|
89
90
|
- spec/fixtures/cassettes/WebmasterTools/_login/passes_with_correct_username_password.yml
|
91
|
+
- spec/fixtures/cassettes/WebmasterTools/_security_token/gets_the_token.yml
|
90
92
|
- spec/fixtures/cassettes/WebmasterTools/_suggest_counts/gets_suggest_counts.yml
|
91
93
|
- spec/fixtures/cassettes/WebmasterTools/amazon_url/_crawl_info/gets_crawl_info.yml
|
92
94
|
- spec/fixtures/cassettes/WebmasterTools/amazon_url/_dashboard/gets_dashboard.yml
|
@@ -124,6 +126,7 @@ test_files:
|
|
124
126
|
- spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts_splitted.yml
|
125
127
|
- spec/fixtures/cassettes/WebmasterTools/_crawl_stats/gets_crawl_stats.yml
|
126
128
|
- spec/fixtures/cassettes/WebmasterTools/_login/passes_with_correct_username_password.yml
|
129
|
+
- spec/fixtures/cassettes/WebmasterTools/_security_token/gets_the_token.yml
|
127
130
|
- spec/fixtures/cassettes/WebmasterTools/_suggest_counts/gets_suggest_counts.yml
|
128
131
|
- spec/fixtures/cassettes/WebmasterTools/amazon_url/_crawl_info/gets_crawl_info.yml
|
129
132
|
- spec/fixtures/cassettes/WebmasterTools/amazon_url/_dashboard/gets_dashboard.yml
|