Beispiel #1
0
def get_private_operate_fb(task_detail):

    xnr_user_no = task_detail['xnr_user_no']
    text = task_detail['text']
    uid = task_detail['uid']

    es_xnr_result = es.get(index=fb_xnr_index_name,
                           doc_type=fb_xnr_index_type,
                           id=xnr_user_no)['_source']

    fb_mail_account = es_xnr_result['fb_mail_account']
    fb_phone_account = es_xnr_result['fb_phone_account']
    password = es_xnr_result['password']

    if fb_phone_account:
        account_name = fb_phone_account
    elif fb_mail_account:
        account_name = fb_mail_account
    else:
        account_name = False

    if account_name:
        mark = fb_message(account_name, password, text, uid)
        print 'private!!'
        #mark = fb_message('8618348831412','Z1290605918',  text, uid)

    else:
        mark = False

    return mark
Beispiel #2
0
def get_private_operate_fb(task_detail):

    xnr_user_no = task_detail['xnr_user_no']
    text = task_detail['text']
    uid = task_detail['uid']
    # add channel and operate_type kn
    channel = task_detail['channel']
    operate_type = task_detail['operate_type']

    es_xnr_result = es.get(index=fb_xnr_index_name,
                           doc_type=fb_xnr_index_type,
                           id=xnr_user_no)['_source']

    fb_mail_account = es_xnr_result['fb_mail_account']
    fb_phone_account = es_xnr_result['fb_phone_account']
    password = es_xnr_result['password']

    if fb_phone_account:
        account_name = fb_phone_account
    elif fb_mail_account:
        account_name = fb_mail_account
    else:
        account_name = False

    if account_name:
        # add params from 45 to aliyunn redis like kn
        fb_tweet_params_dict = {}
        fb_tweet_params_dict["account_name"] = account_name
        fb_tweet_params_dict["password"] = password
        fb_tweet_params_dict["text"] = text
        fb_tweet_params_dict["uid"] = uid
        fb_tweet_params_dict["channel"] = channel
        fb_tweet_params_dict["operate"] = operate_type
        print FB_TWEET_PARAMS, '===================================================fb params'
        ali_re.lpush(FB_TWEET_PARAMS, json.dumps(fb_tweet_params_dict))
        mark = fb_message(account_name, password, text, uid)
        #mark = fb_message('13520874771', '13018119931126731x', text, uid)
        print 'private!!'
    #mark = fb_message('8618348831412','Z1290605918',  text, uid)

    else:
        mark = False

    return mark