search_console_api 0.0.2 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f2f148deeca1caa2726aa3ef8d7f5c6fa70a8219d93fb878a45a8492672a62e
4
- data.tar.gz: cf35d2bc4230fb99eb4cb5d31ff72c343e273a3173d633421eb1192f7a3fa0a6
3
+ metadata.gz: 9909e7477906d0d92cadc90ecd8cf2573d2c745da25866bb649cbc286af8a2f4
4
+ data.tar.gz: a53246341e253a27d8abcd229178f19549140e36b3c8ec3365d727a94aa942a4
5
5
  SHA512:
6
- metadata.gz: 3c1898eb1a0624fa0a4e641b88e6f047b6654591bf43fa6d45e16646a6ab79f124aa12412d128cf128c43e3fbba73c84c56644870d8c2b73265788d412155946
7
- data.tar.gz: ba229f7ea69f1a198017a4be145a2219ffec9d00818bfc70fb34f5cee0fe9e5a5a8feba03935e169c8a3f65d4f5b7f411cd6c1171cbbc9556eb9a2aadbfc0939
6
+ metadata.gz: 3d9130eb30906c21ea2e5798b7c4c64c368dcb6eb6960196d623ad4c9bd9e39731c75cfcf6d2fe2ed9875da5d573923dbed63d5199917328870c132a5ca292f1
7
+ data.tar.gz: 3fa282e04cd40b62b8aedfc9bd855c5a6fae06b194cffd0c1baa386aa7944d41ece717ebc2f6f9d42155092484eb6d1332975d153bb540b4d1591166c4f2925c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- search_console_api (0.0.2)
4
+ search_console_api (0.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -21,7 +21,7 @@ module SearchConsoleApi
21
21
 
22
22
  http.request request
23
23
  end
24
- raise SearchConsoleApi::Error.new(response) unless response.is_a?(Net::HTTPSuccess)
24
+ raise SearchConsoleApi::Error.new(response.body) unless response.is_a?(Net::HTTPSuccess)
25
25
 
26
26
  JSON.parse response.body
27
27
  end
@@ -38,7 +38,7 @@ module SearchConsoleApi
38
38
  request.body = payload
39
39
 
40
40
  response = https.request(request)
41
- raise SearchConsoleApi::Error.new(response) unless response.is_a?(Net::HTTPSuccess)
41
+ raise SearchConsoleApi::Error.new(response.body) unless response.is_a?(Net::HTTPSuccess)
42
42
 
43
43
  JSON.parse response.body
44
44
  end
@@ -1,3 +1,5 @@
1
+ require "date"
2
+
1
3
  module SearchConsoleApi
2
4
  module Resources
3
5
  module SearchAnalytics
@@ -5,8 +7,8 @@ module SearchConsoleApi
5
7
  def initialize(access_token:, site: nil, start_date: nil, end_date: nil, dimensions: [], type: nil, dimension_filter_groups: [], aggregation_type: nil, row_limit: nil, start_row: nil, data_state: nil)
6
8
  @access_token = access_token
7
9
  @site = site
8
- @start_date = start_date
9
- @end_date = end_date
10
+ @start_date = DateTime.parse(start_date.to_s).strftime("%Y-%m-%d")
11
+ @end_date = DateTime.parse(end_date.to_s).strftime("%Y-%m-%d")
10
12
  @dimensions = dimensions
11
13
  @type = type
12
14
  @dimension_filter_groups = dimension_filter_groups
@@ -57,4 +59,4 @@ module SearchConsoleApi
57
59
  end
58
60
  end
59
61
  end
60
- end
62
+ end
@@ -1,3 +1,3 @@
1
1
  module SearchConsoleApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_console_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gustavo Garcia