Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.41 KB | None | 0 0
  1. # coding = utf-8
  2. import requests
  3. import random
  4. from datetime import time
  5.  
  6. import time
  7.  
  8. def call(method, options={}, **kwargs):
  9. options['access_token'] ='token'
  10. options['v'] = '5.73'
  11. options.update(kwargs)
  12. resp = requests.get('https://api.vk.com/method/'+method, params=options).json()
  13. if 'error' in resp:
  14. print('VKERROR: {error_code}: {error_msg}'.format(**resp['error']))
  15. return resp
  16.  
  17. def send_message(id, textmessage='',photovar=''):
  18. options = {
  19. 'message' : textmessage,
  20. 'peer_id' : id,
  21. }
  22. if photovar != '':
  23. options['attachment'] = 'photo' + photovar
  24. call('messages.send', options)
  25. print('Message' + '(' + textmessage + ')' + 'and photo' + photovar + 'send to' + '(' + id + ')' )
  26. return
  27.  
  28. def wipe_text(messagecount, id, timer):
  29. textmessage = input("Enter message to send(if nothing entered message text is wipe): ")
  30. i = 0
  31. while i < int(messagecount):
  32. try:
  33. time.sleep(int(timer))
  34. send_message(id, textmessage)
  35. i = i + 1
  36. except Exception as e:
  37. print(e)
  38. def wipe_pictures(messagecount, id, timer):
  39. photomode = input("Enter photomode: \n 1) Post choosed photo \n 2) Post random photo \n")
  40. if photomode == '1':
  41. photo = input("Enter id photo in <owner_id>_<media_id> type: ")
  42. i = 0
  43. while i < int(messagecount):
  44. try:
  45. time.sleep(int(timer))
  46. send_message(id, '', photo)
  47. i = i + 1
  48. except Exception as e:
  49. print(e)
  50. if photomode == '2':
  51. i = 0
  52. while i < int(messagecount):
  53. try:
  54. time.sleep(int(timer))
  55. photos = call('photos.get', album_id='saved')['response']['items']
  56. random.shuffle(photos)
  57. send_message(id, '', '{owner_id}_{id}'.format(**random.choice(photos)))
  58. i = i + 1
  59. except Exception as e:
  60. print(e)
  61. def wipe_picturestext(messagecount, id, timer):
  62. photo = input("Enter id photo in <owner_id>_<media_id> type: ")
  63. textmessage = input("Enter message to send(if nothing entered message text is wipe): ")
  64. i = 0
  65. while i < int(messagecount):
  66. try:
  67. time.sleep(int(timer))
  68. send_message(id, textmessage, photo)
  69. i = i + 1
  70. except Exception as e:
  71. print(e)
  72.  
  73. def wipe_picturesrandomtext(messagecount, id, timer):
  74. photo = input("Enter id photo in <owner_id>_<media_id> type: ")
  75. chars = list("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&amp;*()")
  76. length = input("Input message length")
  77. textmessage = ''
  78. i = 0
  79. while i < int(messagecount):
  80. try:
  81. for _ in range(int(length)):
  82. textmessage += random.choice(chars)
  83. time.sleep(int(timer))
  84. send_message(id, textmessage, photo)
  85. i = i + 1
  86. except Exception as e:
  87. print(e)
  88.  
  89. def wipe_randomtext(messagecount, id, timer):
  90. chars = list("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&amp;*()")
  91. length = input("Input message length")
  92. i = 0
  93. textmessage = ''
  94. while i < int(messagecount):
  95. try:
  96. for _ in range(int(length)):
  97. textmessage += random.choice(chars)
  98. time.sleep(int(timer))
  99. send_message(id, textmessage)
  100. i = i + 1
  101. except Exception as e:
  102. print(e)
  103.  
  104. def main():
  105. print('Welcome to WIPE MACHINE by Kiriharu! All fucking rights recived')
  106. messagecount = input("Enter count of messages to post: ")
  107. id = input("Enter chat id: ")
  108. timer = input("Enter timer in seconds: ")
  109. option = input("Choose you way: \n 1) Text wipe \n 2) Picture wipe(included random mode) \n 3) Text and picture wipe \n 4) Random text and picture wipe \n 5) Random text wipe \n")
  110. if option == '1':
  111. wipe_text(messagecount,id,timer)
  112. main()
  113. if option == '2':
  114. wipe_pictures(messagecount,id,timer)
  115. main()
  116. if option == '3':
  117. wipe_picturestext(messagecount, id, timer)
  118. main()
  119. if option == '4':
  120. wipe_picturesrandomtext(messagecount, id, timer)
  121. main()
  122. if option == '5':
  123. wipe_randomtext(messagecount, id, timer)
  124. main()
  125. return
  126. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement