Ejemplo n.º 1
0
def send_question_content_to_email():
    import mail_send
    mail_content_list = []
    filename = os.path.join('question_json_data.txt')
    with codecs.open(filename, encoding='utf-8') as f:
        count = 0
        for line in f.readlines():#5837
            count += 1
            json_data = json.loads(line)
            title = json_data['title']
            content = json_data['content']
            mail_content_list.append(title + content)
            if count % 20 == 0:
                mail_send.send_email_to_evernote(''.join(mail_content_list))
                print count
                mail_content_list =  []
Ejemplo n.º 2
0
def send_question_content_to_email():
    import mail_send
    mail_content_list = []
    filename = os.path.join('question_json_data.txt')
    with codecs.open(filename, encoding='utf-8') as f:
        count = 0
        for line in f.readlines():  #5837
            count += 1
            json_data = json.loads(line)
            title = json_data['title']
            content = json_data['content']
            mail_content_list.append(title + content)
            if count % 20 == 0:
                mail_send.send_email_to_evernote(''.join(mail_content_list))
                print count
                mail_content_list = []
Ejemplo n.º 3
0
def send_to_evernote():
    from mail_send import send_email_to_evernote
    filename = os.path.join(PATH, 'question_json_data.txt')
    with codecs.open(filename, encoding='utf-8') as f:
        range_from = 0
        index = range_from
        content_list = []
        for line in f.readlines()[range_from:]:
            index += 1
            print 'index:', index
            line_json = json.loads(line.rstrip())
            content = line_json['content']
            content_list.append(content)
            print 'len(content_list):', len(content_list)
            if index % 20 == 0:
                content_20_str = ''.join(content_list)
                send_email_to_evernote(str(index), content_20_str)
                print 'sending sucess...'
                content_list = []
Ejemplo n.º 4
0
def send_to_evernote():
    from mail_send import send_email_to_evernote
    filename = os.path.join(PATH, 'question_json_data.txt')
    with codecs.open(filename, encoding='utf-8') as f:
        range_from = 0
        index = range_from
        content_list = []
        for line in f.readlines()[range_from:]:
            index += 1
            print 'index:', index
            line_json = json.loads(line.rstrip())
            content = line_json['content']
            content_list.append(content)
            print 'len(content_list):', len(content_list)
            if index % 20 == 0:
                content_20_str = ''.join(content_list)
                send_email_to_evernote(str(index), content_20_str)
                print 'sending sucess...'
                content_list = []