webmaster_tools 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -5,9 +5,13 @@
5
5
  * integrate official API
6
6
  * add oauth
7
7
 
8
+ ## v0.1.3 - 15-03-2012
9
+ * rename `suggests` to `suggest_counts`
10
+ * symbolize `crawl_errors_count` keys
11
+
8
12
  ## v0.1.2 - 14-03-2012
9
13
  * added `suggests` support to retreive infos on duplicate meta tags
10
- * updated `crawl_errors_count`to latest webmaster api, **caution** keys changed!
14
+ * updated `crawl_errors_count` to latest webmaster api, **caution** keys changed!
11
15
 
12
16
  ## v0.1.1 - 09-03-2012
13
17
  * update `remove_url` to just have url as input param
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -69,7 +69,7 @@ class WebmasterTools
69
69
  end)]
70
70
  end
71
71
 
72
- def suggests(url)
72
+ def suggest_counts(url)
73
73
  url = CGI::escape norm_url(url)
74
74
  page = agent.get(SUGGESTS % url)
75
75
 
@@ -121,8 +121,8 @@ class WebmasterTools
121
121
  detected = "20#{$3}-#{'%02d' % $1.to_i}-#{'%02d' % $2.to_i}" if /(\d{1,2})\/(\d{1,2})\/(\d{2})/ =~ detected
122
122
  unless category.to_s.empty?
123
123
  sub_hash = split ? (hash[detected] ||= {}) : hash
124
- sub_hash[category] ||= 0
125
- sub_hash[category] += 1
124
+ sub_hash[to_key(category)] ||= 0
125
+ sub_hash[to_key(category)] += 1
126
126
  end
127
127
  hash
128
128
  end
@@ -156,13 +156,5 @@ class WebmasterTools
156
156
  def to_value(value)
157
157
  value.gsub(/\D/, '').to_i
158
158
  end
159
-
160
- # def security_token2(url)
161
- # url = CGI::escape norm_url(url)
162
- # page = agent.get(REMOVAL % [url, url])
163
- # page.form.fields.select do |field|
164
- # field.name == "security_token"
165
- # end.first.value
166
- # end
167
159
  end
168
160
 
@@ -24,19 +24,19 @@ describe WebmasterTools do
24
24
  end
25
25
  end
26
26
 
27
- describe "#suggests", :vcr do
28
- it 'gets suggests' do
29
- webmaster_tools.suggests(url).should == {:duplicate_meta_descriptions=>11104800, :long_meta_descriptions=>52, :short_meta_descriptions=>22, :missing_title_tags=>2, :duplicate_title_tags=>942215}
27
+ describe "#suggest_counts", :vcr do
28
+ it 'gets suggest_counts' do
29
+ webmaster_tools.suggest_counts(url).should == {:duplicate_meta_descriptions=>11104800, :long_meta_descriptions=>52, :short_meta_descriptions=>22, :missing_title_tags=>2, :duplicate_title_tags=>942215}
30
30
  end
31
31
  end
32
32
 
33
33
  describe "#crawl_error_counts", :vcr do
34
34
  it 'gets crawl_error_counts' do
35
- webmaster_tools.crawl_error_counts(url).should == {"Access denied"=>324, "Not found"=>2000, "Other"=>1997, "Server error"=>1039, "Soft 404"=>14}
35
+ webmaster_tools.crawl_error_counts(url).should == {:access_denied=>324, :not_found=>2000, :other=>1997, :server_error=>1039, :soft_404=>14}
36
36
  end
37
37
 
38
38
  it 'gets crawl_error_counts splitted' do
39
- webmaster_tools.crawl_error_counts(url, true).to_a.last.should == ["2012-03-12", {"Server error"=>36, "Other"=>1}]
39
+ webmaster_tools.crawl_error_counts(url, true).to_a.last.should == ["2012-03-12", {:server_error=>36, :other=>1}]
40
40
  end
41
41
  end
42
42
 
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.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-14 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
16
- requirement: &70133281799000 !ruby/object:Gem::Requirement
16
+ requirement: &70341772244860 !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: *70133281799000
24
+ version_requirements: *70341772244860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70133284642560 !ruby/object:Gem::Requirement
27
+ requirement: &70341772260240 !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: *70133284642560
35
+ version_requirements: *70341772260240
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70133284784560 !ruby/object:Gem::Requirement
38
+ requirement: &70341772265660 !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: *70133284784560
46
+ version_requirements: *70341772265660
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: vcr
49
- requirement: &70133284927100 !ruby/object:Gem::Requirement
49
+ requirement: &70341772273240 !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: *70133284927100
57
+ version_requirements: *70341772273240
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: webmock
60
- requirement: &70133284929280 !ruby/object:Gem::Requirement
60
+ requirement: &70341775309260 !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: *70133284929280
68
+ version_requirements: *70341775309260
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:
@@ -87,7 +87,7 @@ files:
87
87
  - spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts_splitted.yml
88
88
  - spec/fixtures/cassettes/WebmasterTools/_crawl_stats/gets_crawl_stats.yml
89
89
  - spec/fixtures/cassettes/WebmasterTools/_login/passes_with_correct_username_password.yml
90
- - spec/fixtures/cassettes/WebmasterTools/_suggests/gets_suggests.yml
90
+ - spec/fixtures/cassettes/WebmasterTools/_suggest_counts/gets_suggest_counts.yml
91
91
  - spec/fixtures/cassettes/WebmasterTools/amazon_url/_crawl_info/gets_crawl_info.yml
92
92
  - spec/fixtures/cassettes/WebmasterTools/amazon_url/_dashboard/gets_dashboard.yml
93
93
  - spec/fixtures/cassettes/WebmasterTools/amazon_url/_remove_url/refuses_url_and_throws_error.yml
@@ -124,7 +124,7 @@ test_files:
124
124
  - spec/fixtures/cassettes/WebmasterTools/_crawl_error_counts/gets_crawl_error_counts_splitted.yml
125
125
  - spec/fixtures/cassettes/WebmasterTools/_crawl_stats/gets_crawl_stats.yml
126
126
  - spec/fixtures/cassettes/WebmasterTools/_login/passes_with_correct_username_password.yml
127
- - spec/fixtures/cassettes/WebmasterTools/_suggests/gets_suggests.yml
127
+ - spec/fixtures/cassettes/WebmasterTools/_suggest_counts/gets_suggest_counts.yml
128
128
  - spec/fixtures/cassettes/WebmasterTools/amazon_url/_crawl_info/gets_crawl_info.yml
129
129
  - spec/fixtures/cassettes/WebmasterTools/amazon_url/_dashboard/gets_dashboard.yml
130
130
  - spec/fixtures/cassettes/WebmasterTools/amazon_url/_remove_url/refuses_url_and_throws_error.yml