SHARE
TWEET

Listdm

a guest Jun 16th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2.    instabot example
  3.  
  4.    Workflow:
  5.    1) Ask Message type
  6.    2) Load messages CSV (if needed)
  7.    3) Send message to each users
  8. """
  9.  
  10. import csv
  11. import os
  12. import sys
  13. import time
  14. import random
  15. import schedule
  16.  
  17. from tqdm import tqdm
  18.  
  19. sys.path.append(os.path.join(sys.path[0], '../'))
  20. from instabot import Bot
  21.  
  22.  
  23. messagesToSend = 1000
  24. banDelay = (864000 / messagesToSend)
  25.  
  26. bot = Bot()
  27. bot.login()
  28.  
  29. def execute():
  30.     a = ["hey", "hello bro", "thanks for following", "whatsup" , "you good" , "boop", ]
  31.    
  32.  
  33.     #messone = 'hello'
  34. #    messtwo = 'hi'
  35. #    messthree = 'thanks for following'
  36. #    messfour = 'hey'
  37.  
  38. #    randomize = random.randint(0,3)
  39. #    if randomize == 0:
  40. #        directMessage = messone
  41. #    if randomize == 1:
  42. #        directMessage = messtwo
  43. #    if randomize == 2:
  44. #        directMessage = messthree
  45. #    if randomize == 3:
  46. #        directMessage = messfour
  47.  
  48. # new method
  49.     with open("cmfollowers.txt") as file:
  50.         instaUsers4 = [l.strip() for l in file]
  51.         bot.send_messages(random.choice(a),instaUsers4)
  52.         print('Waiting ' + str(banDelay) + ' seconds...')
  53.         time.sleep(banDelay)
  54.         print('Sent An Individual Messages To All Users..')
  55.  
  56.  
  57. schedule.every(99999995).minutes.do(execute)
  58. execute()
  59. while True:
  60.     schedule.run_pending()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top