def get_msg_score(email,token, use_psync): # current_time_stamp = get_current_time_stamp() upto_weeks = 4 # past_time_stamp = get_old_time_stamp(7) # token = get_access_token(email) # get_sent_msg_count_in_range(current_time_stamp,past_time_stamp,email,token) sent_stat = [None] * upto_weeks receive_stat = [None] * upto_weeks unread_stat = [None] * upto_weeks # unseen_stat = [None] * upto_weeks # print "get_msg_score" for i in xrange(0,upto_weeks): # print 'i = ',i if i == 0: future_time_stamp = helper.get_current_time_stamp() else: future_time_stamp = helper.get_old_time_stamp(i*7) past_time_stamp = helper.get_old_time_stamp((i+1) * 7) sent_stat[i] = get_msg_count_in_range(future_time_stamp,past_time_stamp,email,token,'from', use_psync) # print 'sent_stat' receive_stat[i] = get_msg_count_in_range(future_time_stamp,past_time_stamp,email,token,'to', use_psync) # print 'receive_stat' unread_stat[i] = get_thread_participant_score_with_tags(future_time_stamp,past_time_stamp,token,'unread',email, use_psync) # print 'unread_stat' # unseen_stat[i] = get_thread_participant_score_with_tags(future_time_stamp,past_time_stamp,token,'unseen',email) # print 'unseen_stat' helper.save_json('sent_last.json',sent_stat) helper.save_json('receive_last.json',receive_stat) helper.save_json('unread_last.json',unread_stat) # helper.save_json('unseen_last.json',unseen_stat) return
def get_last_digest_time_stamp(email_id): payload = {'email_id':email_id} url = base_url + '/server/get_last_digest_time_stamp' r = requests.post(url,data = payload) response = r.json() # print response if response['success'] != 'true': print response return helper.get_old_time_stamp(1) return int(response['time_stamp'])
def get_last_digest_time_stamp(email_id): payload = {'email_id': email_id} url = base_url + '/server/get_last_digest_time_stamp' r = requests.post(url, data=payload) response = r.json() # print response if response['success'] != 'true': print response return helper.get_old_time_stamp(1) return int(response['time_stamp'])
def get_msg_score(email, token, use_psync): # current_time_stamp = get_current_time_stamp() upto_weeks = 4 # past_time_stamp = get_old_time_stamp(7) # token = get_access_token(email) # get_sent_msg_count_in_range(current_time_stamp,past_time_stamp,email,token) sent_stat = [None] * upto_weeks receive_stat = [None] * upto_weeks unread_stat = [None] * upto_weeks # unseen_stat = [None] * upto_weeks # print "get_msg_score" for i in xrange(0, upto_weeks): # print 'i = ',i if i == 0: future_time_stamp = helper.get_current_time_stamp() else: future_time_stamp = helper.get_old_time_stamp(i * 7) past_time_stamp = helper.get_old_time_stamp((i + 1) * 7) sent_stat[i] = get_msg_count_in_range(future_time_stamp, past_time_stamp, email, token, 'from', use_psync) # print 'sent_stat' receive_stat[i] = get_msg_count_in_range(future_time_stamp, past_time_stamp, email, token, 'to', use_psync) # print 'receive_stat' unread_stat[i] = get_thread_participant_score_with_tags( future_time_stamp, past_time_stamp, token, 'unread', email, use_psync) # print 'unread_stat' # unseen_stat[i] = get_thread_participant_score_with_tags(future_time_stamp,past_time_stamp,token,'unseen',email) # print 'unseen_stat' helper.save_json('sent_last.json', sent_stat) helper.save_json('receive_last.json', receive_stat) helper.save_json('unread_last.json', unread_stat) # helper.save_json('unseen_last.json',unseen_stat) return