Esempio n. 1
0
def get_like_operate_fb(task_detail):

    xnr_user_no = task_detail['xnr_user_no']
    _id = task_detail['r_fid']
    #_id = ??????
    uid = task_detail['r_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_like(account_name, password, _id, uid)

    else:
        mark = False

    return mark
Esempio n. 2
0
def get_like_operate_fb(task_detail):

    xnr_user_no = task_detail['xnr_user_no']
    _id = task_detail['r_fid']
    #_id = ??????
    uid = task_detail['r_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["_id"] = _id
        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_like(account_name, password, _id, uid)
        #mark = fb_like('13520874771', '13018119931126731x', _id, uid)
    else:
        mark = False

    return mark