Advertisement
tomateblue

b1

Nov 9th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.52 KB | None | 0 0
  1. from pyautogui import hotkey, typewrite
  2. from time import sleep
  3.  
  4. site = "https://secure.avaaz.org/po/petition/MEC_PIBID_sem_cortes_e_sem_interrupcao/?zisyymb"
  5. file = open("emails").read().split('\n')
  6. n = len(file)-1
  7. a = 6856
  8. p = range(74900001,74906857)
  9. localidade = "Aparecida de Goiania"
  10.  
  11. def openfirefox():
  12.   comandos = ['ctrl','alt','t']
  13.   print comandos
  14.   app = "firefox "
  15.   print app
  16.   hotkey('ctrl','alt','t') # open terminal
  17.   print "open terminal"
  18.   sleep(0.5)        # wait terminal opened
  19.   typewrite(app+site,interval=0.01)
  20.   print "open firefox with site "
  21.   hotkey("enter")  
  22.  
  23. def dados(item):
  24.    nome = file[item].split('@')[0]
  25.    email = file[item]
  26.    localidade = "Aparecida"
  27.    return [email,nome,localidade]
  28.  
  29. def spaces(numbers):
  30. # 3 tab tab tab = email 4 tab tab tab tab = nome 5 tab tab tab tab tab = 13 Brazil  6 tab tab tab tab tab tab = CEP 7 tab tab tab tab tab tab tab = CIDADE 8 tab tab tab tab tab tab tab tab = Pq isso ser importante 9 tab tab tab tab tab tab tab tab tab = assine
  31.   for p in range(numbers):
  32.      hotkey("tab")
  33.      print p,'tab'
  34.      sleep(0.1)
  35.  
  36. def write(text):
  37.      typewrite(text,interval=0.02)
  38.  
  39.  
  40. def main():
  41.  for p in  range(a):
  42.   print "VOTO: ",p
  43.   openfirefox()
  44.   sleep(5)
  45.   spaces(8)
  46.   email,name,localidade = dados(p)
  47.   write(email)
  48.   spaces(4)
  49.   hotkey('space')
  50.   spaces(27)
  51.   hotkey("enter")
  52.   sleep(10)
  53.   for p in range(6):
  54.    hotkey("ctrl","w")
  55.    sleep(0.5)
  56.   for p in range(4):
  57.    hotkey("ctrl","d")  
  58.  
  59.  
  60.  
  61. while 1:
  62.    main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement