def getArguments(): dateList = collectArguments.getDates() date1 = dateList[0] date2 = dateList[1] filename = collectArguments.getFilename() #filename = 'C:\\Users\\thambapillair\\Documents\\'+ raw_input('Enter preferred filename')+'.txt' dimensionString = collectArguments.collectArguments(dimensions_and_metrics.dimensions) metricString = collectArguments.collectArguments(dimensions_and_metrics.metrics) #print metricString dimensionList = collectArguments.collectLists(dimensionString) #metricList = metricString.split(',') metricList = collectArguments.collectLists(metricString) #print dimensionList,metricList segment_id = collectArguments.getSegments() #for z in range (0,len(dimensionList)-1): #print metricList[z] #print z returnList = [date1,date2,dimensionString,metricString,dimensionList,metricList,filename,segment_id] return returnList
from oauth2client.client import AccessTokenRefreshError globalOutputList = [] #date1 = raw_input('Enter Start Date as YYYY-MM-DD ') #date2 = raw_input('Enter End Date as YYYY-MM-DD ') dateList = collectArguments.getDates() date1 = dateList[0] date2 = dateList[1] filename = collectArguments.getFilename() #filename = 'C:\\Users\\thambapillair\\Documents\\'+ raw_input('Enter preferred filename')+'.txt' myNewFile = open (filename , 'w+') checkList = ['Profile', 'H - SendIt', 'A - Zavvi', 'A - TheHut.com', 'H - zavvi.es', 'H - mybag.com', 'J - iwantoneofthose.com', 'H - zavvi.nl', 'H - allsole.com', 'www.hqhair.com/', 'http://www.myprotein.com', 'www.mankind.co.uk', 'www.beautyexpert.co.uk', 'www.lookfantastic.com', 'www.lookmantastic.com', 'www.myvitamins.com', 'www.lookfantastic.net', 'www.myprotein.ie', 'www.myprotein.it', 'www.myprotein.es', 'fr.myprotein.com', 'de.myprotein.com','PBK EUR','PBK NOK','PBK YEN','PBK SEK','PBK INR', 'PBK CYR', 'PBK NZD', 'PBK ZAR','PBK AUS','PBK DKK','PBK HKD', 'PBK USD', 'PBK RUB', 'PBK CHF', 'PBK GBP (was all)','PBK CAD (wrong currency symbol)'] activeWebsites = {"UA-59323-77": "AllSole", "UA-59323-83":"HQHair","UA-59323-75":"Iwoot","UA-59323-61":"MyBag", "UA-59323-24":"Sendit","UA-59323-4":"TheHut","UA-59323-37":"Zavvi","UA-59323-58":"Zaavi.es","UA-59323-76":"Zavvi.nl","UA-9345964-1":"LookFantastic","UA-18807547-1":"Lookfantastic.net","UA-10211190-1":"lookmantastic","UA-19257214-1":"http://www.myprotein.com/de/pages/home","UA-19256573-1":"http://www.myprotein.com/es/pages/home","UA-19256640-1":"http://www.myprotein.com/fr/pages/home","UA-19256474-1":"http://www.myprotein.com/ie/pages/home","UA-19256561-1":"http://www.myprotein.com/it/pages/home","UA-479953-1":"http://www.myprotein.com/uk","UA-2620226-2":"http://www.beautyexpert.co.uk","UA-2620226-1":"http://www.mankind.co.uk","UA-18594156-35": "http://www.myvitamins.com","UA-3095960-8":"http://probikekit.com EUR","UA-3095960-12":"http://probikekit.com NOK","UA-3095960-10":"http://probikekit.com YEN","UA-3095960-14":"http://probikekit.com SEK","UA-3095960-18":"http://probikekit.com INR","UA-3095960-17":"http://probikekit.com CYR","UA-3095960-11":"http://probikekit.com NZD","UA-3095960-13":"http://probikekit.com ZAR","UA-3095960-5":"http://probikekit.com AUS","UA-3095960-7":"http://probikekit.com DKK","UA-3095960-16":"http://probikekit.com USD","UA-3095960-1":"http://probikekit.com GBP"} dimensionString = collectArguments.collectArguments(dimensions_and_metrics.dimensions) metricString = collectArguments.collectArguments(dimensions_and_metrics.metrics) print metricString dimensionList = collectArguments.collectLists(dimensionString) #metricList = metricString.split(',') metricList = collectArguments.collectLists(metricString) print dimensionList,metricList for z in range (0,len(metricList)-1): print metricList[z] print z def main(argv): service = hello_analytics_api_v3_auth.initialize_service() accounts = service.management().accounts().list().execute() counter = 0 segmentName = raw_input('Please Enter your preferred Segment Name (Hit Enter for All Visits)\n') try: