Esempio n. 1
0
def publish_tweet_func(account_name, password, text, p_url, rank, rankid,
                       tweet_type, xnr_user_no):

    xnr = SinaLauncher(account_name, password)
    xnr.login()
    user = SinaOperateAPI(xnr.uid)
    user.text = text
    user.rank = rank

    new_p_url = user.request_image_url(p_url)

    user.pic_ids = ' '.join(new_p_url)
    user.rankid = rankid
    #print 'user.pic_ids::',user.pic_ids
    mark = user.publish()
    print 'mark...', mark
    # 保存微博
    if mark:
        try:
            save_mark = save_to_xnr_flow_text(tweet_type, xnr_user_no, text)
        except:
            print '保存微博过程遇到错误!'
            save_mark = False

    return mark
Esempio n. 2
0
def private_tweet_func(account_name, password, text, r_mid):
    xnr = SinaLauncher(account_name, password)
    xnr.login()
    user = SinaOperateAPI(xnr.uid)
    user.text = text
    user.r_mid = r_mid
    mark = user.privmessage()

    return mark
Esempio n. 3
0
def reply_tweet_func(account_name, password, text, r_mid, mid, uid):
    xnr = SinaLauncher(account_name, password)
    xnr.login()
    user = SinaOperateAPI(xnr.uid)
    user.text = text
    user.r_mid = r_mid
    # user.r_uid = xnr.uid
    user.uid = uid
    user.cid = mid
    mark = user.receive()
    return mark
Esempio n. 4
0
def retweet_tweet_func(account_name, password, text, r_mid, tweet_type,
                       xnr_user_no):

    xnr = SinaLauncher(account_name, password)
    xnr.login()
    user = SinaOperateAPI(xnr.uid)
    user.text = text
    user.r_mid = r_mid
    mark = user.retweet()

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

    return mark