Untitled

 avatar
unknown
plain_text
a year ago
2.3 kB
3
Indexable
# 1 criar um bot que define qual a página quer seguir
# 2 verificar se a postagem mais atual ainda não foi curtida pelo bot
# 3 caso uma nova postagem tenha sido feita, ele deve entrar nessa postagem
# 4 curtie e comentar algo nela

import pyautogui
from time import sleep
import webbrowser
def bot_instagram():
        webbrowser.open_new_tab('instagram.com')
        sleep(8)
        pyautogui.click(pyautogui.locateCenterOnScreen('login.png'))
        pyautogui.typewrite('macielfb@gmail.com')
        sleep(6)
        pyautogui.click(pyautogui.locateOnScreen('senha.png'))
        pyautogui.typewrite('fb111109m')
        sleep(0.5)
        pyautogui.click(pyautogui.locateCenterOnScreen('entrar.png'))
        sleep(16)
        pyautogui.click(pyautogui.locateCenterOnScreen('lupa.png'))
        sleep(9)
        pyautogui.typewrite('devaprender')
        sleep(7)
        pyautogui.click(pyautogui.locateCenterOnScreen('dev.png'))
        sleep(8)
        pyautogui.scroll(-500)
        sleep(10)
        pyautogui.moveTo(474,299, duration=1)
        pyautogui.click()
        sleep(6)
        pyautogui.click(pyautogui.locateCenterOnScreen('menu.png'))
        sleep(11)
        pyautogui.click(pyautogui.locateCenterOnScreen('ir.png'))
        sleep(9)

bot_instagram()
coracao_vermelho = ('v.png')

while True:
  try:
    pyautogui.locateOnScreen(coracao_vermelho)
    print('A publicação já foi curtida')
    sleep(2)    
    pyautogui.click(pyautogui.locateOnScreen('mais.png'))
    sleep(4)
    pyautogui.click(pyautogui.locateOnScreen('sair.png'))
    sleep(8)
    pyautogui.hotkey('ctrl','w')
    sleep(86400)
    bot_instagram()
  
  except:
    pyautogui.moveTo(956, 579)
    pyautogui.click(pyautogui.moveTo(956, 578, duration=2))
    sleep(2)
    pyautogui.click(pyautogui.locateOnScreen('comentar.png'))
    pyautogui.typewrite('Muito bom')
    pyautogui.click(pyautogui.locateOnScreen('publicar.png'))        
    sleep(5)    
    pyautogui.click(pyautogui.locateOnScreen('mais.png'))        
    sleep(2)
    pyautogui.click(pyautogui.locateOnScreen('sair.png'))
    sleep(8)
    pyautogui.hotkey('ctrl','w')
    print('terminou') 
    
    sleep(86400)
    bot_instagram()
Editor is loading...
Leave a Comment