Example #1
0
def fb_add_friend(account_name,password, uid):

    operation = Operation(account_name,password)
    
    try:
        print operation.add_friend(uid)
        mark = True
    except Exception,e:
        print e
        mark = False
Example #2
0
def fb_delete_friend(account_name,password, uid):

    operation = Operation(account_name,password)
    
    #try:
    print operation.delete_friend(uid)
    mark = True
    # except:
    #     mark = False

    return mark
Example #3
0
def fb_confirm(account_name,password, uid):

    operation = Operation(account_name,password)
    
    try:
        print operation.confirm(uid)
        mark = True
    except:
        mark = False

    return mark
Example #4
0
def fb_like(account_name, password, _id, uid):
    # uid: 原贴用户id
    operation = Operation(account_name, password)

    #try:
    operation.like(uid, _id)
    mark = True
    # except:
    #     mark = False

    return mark
Example #5
0
def fb_message(account_name,password, text, uid):
    print 'account_name...',account_name
    print 'password.......',password
    operation = Operation(account_name,password)
    
    #try:
    print operation.send_message(uid, text)
    mark = True
    # except:
    #     mark = False

    return mark
def fb_like(account_name, password, _id, uid):
    # uid: 原贴用户id
    operation = Operation(account_name, password)
    print 'uid', uid
    #try:
    _id = _id.split('_')[1]
    print 'fid', _id
    operation.like(uid, _id)
    mark = True
    # except:
    #     mark = False

    return mark
Example #7
0
def fb_unfollow(account_name, password, uid, xnr_user_no):

    operation = Operation(account_name,password)
    
    # try:
    print operation.not_follow(uid)
    mark = True
    # except:
    #     mark = False

    #save_type = 'friends'
    follow_type = 'unfollow'
    # trace_type = 'trace_follow' or 'ordinary_follow'
    trace_type = 'trace_follow'

    # fb_save_to_fans_follow_ES(xnr_user_no,uid,follow_type,trace_type)

    return mark
Example #8
0
def fb_comment(account_name, password, _id, uid, text, tweet_type, xnr_user_no):

    operation = Operation(account_name,password)
    
    #try:
    print operation.comment(uid,_id,text)
    mark = True
    # except:
    #     mark = False

    message_type = 2 # 评论
    
    # try:
    #     save_mark = fb_save_to_xnr_flow_text(tweet_type,xnr_user_no,text,message_type)
    # except:
    #     print '保存微博过程遇到错误!'
    #     save_mark = False

    return mark
Example #9
0
def fb_follow(account_name, password, uid, xnr_user_no, trace_type):

    operation = Operation(account_name,password)
    
    #try:
    print '11111'
    operation.follow(uid)
    print '22222'
    mark = True
    # except:
    #     mark = False

    #save_type = 'followers'
    follow_type = 'follow'
    # trace_type = 'trace_follow' or 'ordinary_follow'
    if trace_type == 'trace_follow':
        fb_save_to_fans_follow_ES(xnr_user_no,uid,follow_type,trace_type)

    return mark
Example #10
0
def fb_retweet(account_name, password, _id, uid, text, tweet_type, xnr_user_no):

    print 'account_name,password....',account_name,password
    operation = Operation(account_name,password)
    
    #try:
    print operation.share(uid,_id,text)
    mark = True
    # except:
    #     mark = False

    message_type = 3 # 转发
    
    # try:
    #     save_mark = fb_save_to_xnr_flow_text(tweet_type,xnr_user_no,text,message_type)
    # except:
    #     print '保存微博过程遇到错误!'
    #     save_mark = False

    return mark
Example #11
0
def fb_mention(account_name,password, user_name, text, xnr_user_no, tweet_type):
    # uid: 原贴用户id
    operation = Operation(account_name,password)
    
    #try:

    print operation.mention(user_name, text)
    mark = True
    # except:
    #     mark = False
    
    message_type = 4 # 提到
    
    # try:
    #     save_mark = fb_save_to_xnr_flow_text(tweet_type,xnr_user_no,text,message_type)
    # except:
    #     print '保存微博过程遇到错误!'
    #     save_mark = False

    return mark
Example #12
0
def fb_publish(account_name, password, text, tweet_type, xnr_user_no):
    print 'account_name,password..',account_name,password
    operation = Operation(account_name,password)
    
    #try:
    print 'fb111'
    print operation.publish(text)
    print 'fb222'
    mark = True
    # except:
    #     mark = False

    message_type = 1 # 原创

    try:
        save_mark = fb_save_to_xnr_flow_text(tweet_type,xnr_user_no,text,message_type)
    except:
        print '保存微博过程遇到错误!'
        save_mark = False

    return mark
Example #13
0
def fb_publish(account_name, password, text, tweet_type, xnr_user_no):
    print '123'
    print 'account_name,password..', account_name, password
    operation = Operation(account_name, password)
    print 'operation...', operation
    print operation.publish(text)
    mark = True
    # except:
    #     mark = False

    message_type = 1  # 原创

    #try:
    save_mark = fb_save_to_xnr_flow_text(tweet_type, xnr_user_no, text,
                                         message_type)
    print 'save_mark..', save_mark
    #except:
    #    print '保存微博过程遇到错误!'
    #    save_mark = False

    return save_mark
Example #14
0
def fb_retweet(account_name, password, _id, uid, text, tweet_type,
               xnr_user_no):

    print 'account_name,password....', account_name, password
    operation = Operation(account_name, password)
    print "uid", uid
    _id = _id.split('_')[1]
    print "fid", _id, type(_id)
    #try:
    print operation.share(uid, _id, text)
    mark = True
    # except:
    #     mark = False

    message_type = 3  # 转发

    try:
        save_mark = fb_save_to_xnr_flow_text(tweet_type, xnr_user_no, text,
                                             message_type)
    except:
        print '保存微博过程遇到错误!'
        save_mark = False

    return save_mark