Advertisement
Guest User

Untitled

a guest
Feb 1st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.62 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.  
  20.  
  21.  
  22. t_yan_ids = []
  23.  
  24. cur_number_of_queries = 0
  25.  
  26. for dialog in dialogs:
  27.     if type(dialog) is dict:
  28.         cur_number_of_queries += 1
  29.         user_t = vk_api.users.get(user_ids=[dialog['uid']], fields=['sex'])
  30.  
  31.         if len(user_t) > 0:
  32.             user = user_t[0]
  33.         if ('sex' in user) and user['sex'] == 1:
  34.             t_yan_ids.append(user['uid'])
  35.         if cur_number_of_queries == 7:
  36.             time.sleep(3)
  37.             cur_number_of_queries = 0
  38.  
  39. random.shuffle(t_yan_ids)
  40. print("Скольких тян ты хочешь закадрить!?")
  41.  
  42. k = int(input())
  43.  
  44.  
  45. while len(t_yan_ids) < k:
  46.     print("у тебя не так уж и много знакомых тянок хах, введи еще раз число")
  47.     k = int(input())
  48.  
  49. cur_number_of_queries = 0
  50.  
  51. for i in range(k):
  52.     cur_number_of_queries += 1
  53.     try:
  54.         vk_api.messages.send(user_id=t_yan_ids[i], message="ГО САСАЦА")
  55.     except:
  56.         print("Одной из тян не вышло отправить сообщение :с (там либо чс либо еще чет лох ты короч)")
  57.     if cur_number_of_queries == 7:
  58.         time.sleep(3)
  59.         cur_number_of_queries = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement