Advertisement
bloodie_lie

pnax

Jul 18th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. import vk_api
  2. import time
  3. import random
  4.  
  5. vk = vk_api.VkApi(login = '', password = '')
  6. vk.auth()
  7.  
  8. i = -1
  9. comment = ['Привит работяги','Мда одмен курага','Сейчас бы манго','Наица','Не наица','Пользуясь случаем хочу сказать Володя арангутанг']
  10. id = [-57846937, -28905875, -103083994, -156480091, -174949577]
  11.  
  12. print('Время старта:' + time.ctime() + '\n')
  13.  
  14. while True:
  15.     i = i + 1
  16.     if i > 4:
  17.         i = 0
  18.     with vk_api.VkRequestsPool(vk) as pool:
  19.         newsfeed = pool.method('newsfeed.get', {'count': 1,'source_ids':id[i]})            
  20.     s = random.choice(comment)
  21.     if newsfeed.result["items"][0]['comments']['can_post'] == 1 and newsfeed.result["items"][0]['comments']['count'] == 0:
  22.         vk.method('wall.createComment',{'owner_id':newsfeed.result['items'][0]['source_id'],'post_id':newsfeed.result['items'][0]['post_id'],'message':s})
  23.         print('Время:' + time.ctime())
  24.         print('Оставлен комментарий Source_id группы:' + str(newsfeed.result['items'][0]['source_id']) + '\nPost_id:' + str(newsfeed.result['items'][0]['post_id']) + '\nТекст:' + s + '\n')                     
  25.         time.sleep(0.00001)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement