def get_comment_operate_fb(task_detail): text = task_detail['text'] tweet_type = task_detail['tweet_type'] 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_comment(account_name, password, _id, uid, text, tweet_type, xnr_user_no) else: mark = False return mark
def get_comment_operate_fb(task_detail): text = task_detail['text'] tweet_type = task_detail['tweet_type'] xnr_user_no = task_detail['xnr_user_no'] _id = task_detail['r_fid'] # add channel and operate_type kn channel = task_detail['channel'] operate_type = task_detail['operate_type'] #_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: # add params from 45 to aliyunn redis 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["text"] = text fb_tweet_params_dict["tweet_type"] = tweet_type fb_tweet_params_dict["xnr_user_no"] = xnr_user_no 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_comment(account_name, password, _id, uid, text, tweet_type, xnr_user_no) #mark = fb_comment('13520874771', '13018119931126731x', _id, uid, text, tweet_type, xnr_user_no) else: mark = False return mark