N
N
NNull2019-02-13 03:15:38
Python
NNull, 2019-02-13 03:15:38

I can't send a comment under the post, what should I do?

I wrote a program that sends a comment first, but it sends the first comment only on my
group wall, under a post
in other groups with millionaires - the result is 0, and nothing is displayed, 0 errors i.e.
maybe it's in the captcha, but before dealing with the captcha, I would like to ask the opinions of the pros

import vk
import time
tok = 'token'
session = vk.Session(access_token=tok)
vk_api = vk.API(session,  v='5.92', lang='ru', timeout=10)
id_club = <id сообщества с минусом>
id_club_m = <id сообщества без минуса>
message_text = 'блин, опять не первый...'
a = vk_api.wall.get(owner_id=id_club,count=1)
x = a['items'][0]['id']
while True:
    time.sleep(1)
    if vk_api.wall.get(owner_id=id_club,count=1)['items'][0]['id'] != x:
        print('Новая запись '+'vk.com/club'+str(id_club_m)+'?w=wall'+str(id_club)+'_'+str(vk_api.wall.get(owner_id=id_club,count=1)['items'][0]['id']))
        vk_id = vk_api.wall.get(owner_id=id_club,count=1)['items'][0]['id']
        vk_api.wall.createComment(owner_id=id_club,post_id=vk_id,message=message_text)
        print('\n ------- \n работа программы завершена, запустите снова что бы оставить комментарий первым')
        break

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question