Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import vk_api
- import time
- import random
- vk = vk_api.VkApi(login = '', password = '')
- vk.auth()
- i = -1
- comment = ['Привит работяги','Мда одмен курага','Сейчас бы манго','Наица','Не наица','Пользуясь случаем хочу сказать Володя арангутанг']
- id = [-57846937, -28905875, -103083994, -156480091, -174949577]
- print('Время старта:' + time.ctime() + '\n')
- while True:
- i = i + 1
- if i > 4:
- i = 0
- with vk_api.VkRequestsPool(vk) as pool:
- newsfeed = pool.method('newsfeed.get', {'count': 1,'source_ids':id[i]})
- s = random.choice(comment)
- if newsfeed.result["items"][0]['comments']['can_post'] == 1 and newsfeed.result["items"][0]['comments']['count'] == 0:
- vk.method('wall.createComment',{'owner_id':newsfeed.result['items'][0]['source_id'],'post_id':newsfeed.result['items'][0]['post_id'],'message':s})
- print('Время:' + time.ctime())
- print('Оставлен комментарий Source_id группы:' + str(newsfeed.result['items'][0]['source_id']) + '\nPost_id:' + str(newsfeed.result['items'][0]['post_id']) + '\nТекст:' + s + '\n')
- time.sleep(0.00001)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement