12345678910111213141516171819202122232425262728 |
- import traceback
- import copy
- import operator
- import codecs
- import sys
- import os
- import searchconsole
- account = searchconsole.authenticate(client_config='data/client_secret.json',credentials='data/credentials.json')
- def get_monthly_report(monthnum):
- webproperty = account['https://bhouse.com.tw/']
-
-
-
- report=webproperty.query.range('today', months=monthnum).dimension('query').get()
- results=[]
- for r in report:
- results.append([r[0],r[1],r[2],r[3],float(r[4])])
- return results
|