Ejemplo n.º 1
0
def send_daily_data():
    jobdata = get_latest_data()
    store_job = Job_Data(store_type='redis')
    store_job.store(jobdata)
    result = data2html(jobdata,'job.tpl')
    mail = SendMail('Job')
    try:
        mail.send_email(msghtml=result)
    except:
        mail.send_email(msghtml=result)
Ejemplo n.º 2
0
def send_good_job():
    gjob = GoodJob()
    renderg = gjob.get_renderg()
    huaxia = gjob.get_huaxia()
    data = []
    if renderg:
        data.extend(renderg)
    if huaxia:
        data.extend(huaxia)
    if data:
        result = data2html(data,'job.tpl')
        mail = SendMail('Job')
        try:
            mail.send_email(msghtml=result)
        except:
            mail.send_email(msghtml=result)
    else:
        print '%s:No job info about the companies' % datetime.date.today().strftime("%Y-%m-%d")