Exemplo n.º 1
0
def reply_comment_by_travel_id(_id, comment_new=False):
    token, s = get_login_token()
    print comment_new
    if comment_new == False:
        print "false"
        comments_list = get_comments_ids_by_travel_id(_id)
    else:
        print "true"
        comments_list = get_comments_ids_by_travel_id2(_id)

    #trail = get_trail_id_by_travel_id(_id)
    for c in comments_list:
        if c['created_by'] == str(FUCKME_ID):
            continue
        comment_pool = [u"这张照片很赞,你觉得呢?",
                        u"你不觉得我们应该为楼主点个赞吗?",
                        u"举手之劳,为楼主点个赞吧!",
                        u"我觉得我们应该点个赞来鼓励楼主。",
                        u"楼主就差2个赞就凑齐32个赞了,点吧。",
                        u"楼主因为没有赞已经吃不下饭了,我们帮帮他吧。",
                        u"轻轻一按,给你个赞。同学你也试试。",
                        u"你为什么不为楼主点个赞呢?"]
        comment = random.choice(comment_pool)
        comment = u"回复" + c['nickname'] + ":" + comment
        parent_id = c['id']
        post_id = c['post_id']
        ret = do_comment_pic(post_id, token, s, comment, parent_id)
        if ret:
            print "reply %s, comment: %s" % (c['nickname'], comment)
        else:
            print "replay %s failed" % c['nickname']
Exemplo n.º 2
0
def comment_all_pics_by_travel_id(_id):
	email = u"*****@*****.**"
	name = u"f****e"
	passwd = u"f****e"

	token,s = get_login_token(email, passwd)

	log_data = get_travel_log_by_id(_id, token)

	post_list = json.loads(log_data)['log']['posts']
	pic_list = [int(pic['id']) for pic in post_list]
	
	for _id in pic_list:
		comment = get_one_comment()
		print comment
		ret = do_comment_pic(_id, token, s, comment)
		if ret:
			print("comment successfully")