Advertisement
Guest User

Untitled

a guest
Jun 28th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. import vk
  2. import time
  3. import random
  4.  
  5.  
  6. random.seed(time.time())
  7. print("Введи телефончик")
  8. login = input()
  9. print("Введи парольчик")
  10. password = input()
  11.  
  12. session = vk.AuthSession(6356219, login, password, scope='wall, messages')
  13. vk_api = vk.API(session)
  14.  
  15.  
  16. print("Жди, ща я посмотрю кто у тебя там...")
  17. dialogs = vk_api.messages.getDialogs(count=200)
  18.  
  19. t_yan_ids = []
  20.  
  21. cur_number_of_queries = 0
  22.  
  23. for dialog in dialogs:
  24. if type(dialog) is dict:
  25. cur_number_of_queries += 1
  26. user = vk_api.users.get(user_ids=[dialog['uid']], fields=['sex'])[0]
  27. if user['sex'] == 1:
  28. t_yan_ids.append(user['uid'])
  29. if cur_number_of_queries == 7:
  30. time.sleep(3)
  31. cur_number_of_queries = 0
  32.  
  33. random.shuffle(t_yan_ids)
  34. print("Скольких тян ты хочешь закадрить!?")
  35.  
  36. k = int(input())
  37.  
  38.  
  39. while len(t_yan_ids) < k:
  40. print("у тебя не так уж и много знакомых тянок хах, введи еще раз число")
  41. k = int(input())
  42.  
  43. cur_number_of_queries = 0
  44.  
  45. for i in range(k):
  46. cur_number_of_queries += 1
  47. try:
  48. vk_api.messages.send(user_id=t_yan_ids[i], message="Го сосаца")
  49. except:
  50. print("Одной из тян не вышло отправить сообщение :с (там либо чс либо еще чет лох ты короч)")
  51. if cur_number_of_queries == 7:
  52. time.sleep(3)
  53. cur_number_of_queries = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement