Answer the question
In order to leave comments, you need to log in
Why can't I specify 2 join subject and To?
You need to parse the gmail box to the account of sent letters, you need to parse the fields to whom. topic, well, and a request for a specific date.
r = {"To": None, "Subject": None}
for i in response["payload"]["headers"]:
if i["name"] in r.keys():
r[i["name"]] = i["value"]
user_id='me'
req_date = ("%s-%s-%s" % (flags.year,flags.month,flags.day))
date = datetime.datetime.strptime(req_date , '%Y-%m-%d').date()
before_date = return_tomorrows_date(date)
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
service = discovery.build('gmail', 'v1', http=http)
query = ('from:%s after:%s before:%s' % (flags.sender, date, before_date))
messages = ListMessagesMatchingQuery(service,user_id,query)
generate_results(req_date,flags.sender,",".join([x["Subject"] for x in messages])) или generate_results(req_date,flags.sender,",".join([x["To"] for x in messages]))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question