g_ruby 0.0.1 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c30db117724c3d5efe55618c3a0b84ac1c541c73
4
- data.tar.gz: 71f46c5ec2ccfcafe219275c646ffe5e47a36853
3
+ metadata.gz: 89cf9ad379738fe1cc5ac11eb32b7e05dc4ba2ad
4
+ data.tar.gz: 0b4a62d5dda205b2c6f9d562b5b50c575719e45d
5
5
  SHA512:
6
- metadata.gz: d0dcbfdbea847a75e7015645832d391758869d21c1e3a524790c7e138d51018ee9087a9f53b9087ed10880b6c220e9b5fe3a0e0e8e5d019d6865d6a2f7de44d5
7
- data.tar.gz: b58414db3ad6aac8dda42ad77b8b2b55324057baf94f2cfd1f8f2022287202dc4e9e45bdb0b37d343b7827b5ac9e7292978256dd67b4b370e4ab5d2157674a86
6
+ metadata.gz: b64ada8be3dbb13f30bfb63bf2c819842265d934bd80783079d390142388d0cb0aac96160e97a8d0961fd0d8d1de441b875b38ccc2d92ce070920c7394b77f8c
7
+ data.tar.gz: 0bc55d9ed48513113413efb00d1929acdeac61855988939cb8ffee8c6a38188155ea718f75665a8bfd23d424f37a52e79f0b466e63b05838931950261416ff16
@@ -6,10 +6,12 @@ class GRuby::Analytics
6
6
 
7
7
  #---------------------------------------------------------------------------------------------------
8
8
 
9
+ a_json = GRuby::Analytics.get(ak.app_password, start_date, end_date, ak.entity_name, "ga:visits", "ga:medium", "-ga:visits", nil)
10
+
9
11
  #GRuby::Analytics.get(access_token, start_date, end_date, profile_id, metrics, dimensions, sort, max_results)
10
12
  def self.get(access_token, start_date, end_date, profile_id, metrics, dimensions=nil, sort=nil, limit=nil)
11
13
  #begin
12
- url = GA_BASE + "#{access_token}&start-date=#{start_date}&end-date=#{end_date}&ids=ga:#{profile_id}&metrics=#{metrics}"
14
+ url = "https://www.googleapis.com/analytics/v3/data/ga?access_token=#{access_token}&start-date=#{start_date}&end-date=#{end_date}&ids=ga:#{profile_id}&metrics=#{metrics}"
13
15
  url = url + "&dimensions=#{dimensions}" if !dimensions.blank?
14
16
  url = url + "&sort=#{sort}" if !sort.blank?
15
17
  url = url + "&max-results=#{limit}" if !limit.blank?
data/lib/g_ruby/auth.rb CHANGED
@@ -14,5 +14,11 @@ class GRuby::Auth
14
14
  g = Nestful.post "https://accounts.google.com/o/oauth2/token?method=POST&grant_type=authorization_code&code=#{auth_code}&client_id=#{GOOGLE_CLIENTID}&client_secret=#{GOOGLE_SECRET}&redirect_uri=#{GOOGLE_CALLBACK}"
15
15
  return GRuby::Util.get_json(g)
16
16
  end
17
+
18
+ #GRuby::Auth.refresh(refresh_token)
19
+ def self.refresh(refresh_token)
20
+ g = Nestful.post "https://accounts.google.com/o/oauth2/token?method=POST&grant_type=refresh_token&refresh_token=#{refresh_token}&client_id=#{GOOGLE_CLIENTID}&client_secret=#{GOOGLE_SECRET}"
21
+ return GRuby::Util.get_json(g)
22
+ end
17
23
 
18
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pykih Software