From 0e3588e8467739b6e7ab9e04feeaf289de6a20fc Mon Sep 17 00:00:00 2001 From: Karolis Rusenas Date: Wed, 29 Jul 2015 09:29:56 +0100 Subject: [PATCH] adding option to specify date range in config file --- app_conf.yaml.example | 2 ++ run.py | 1 + 2 files changed, 3 insertions(+) diff --git a/app_conf.yaml.example b/app_conf.yaml.example index 646537b..165efd0 100644 --- a/app_conf.yaml.example +++ b/app_conf.yaml.example @@ -6,9 +6,11 @@ applicationSettings: # Details for querying google analytics API # don't forget to add it to your analytics users, profileId - add your google analytics profile ID +# startDaysAgo - specify start date, it can be 7, 20, 30 days ago, this value should be integer googleAnalyticsApi: serviceAccount: '__your_service_account@developer.gserviceaccount.com' profileId: '__your_profile__id' + startDaysAgo: 7 # application credentials from APIs & auth > credentials > Client ID for native application # key represents "Client ID", secret is "Client secret". Oauth module expects to find "google_oauth" in app settings diff --git a/run.py b/run.py index e95f1eb..7b3de00 100755 --- a/run.py +++ b/run.py @@ -40,6 +40,7 @@ def __init__(self): try: settings["service_account_email"] = document["googleAnalyticsApi"]["serviceAccount"] settings["ga_profile_id"] = document["googleAnalyticsApi"]["profileId"] + settings["start_days_ago"] = int(document["googleAnalyticsApi"]["startDaysAgo"]) except Exception as ex: print("Check your google service account details: %s" % ex) sys.exit(1)