⎗ ✓ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52import requests import time from bs4 import BeautifulSoup from notifypy import Notify def get_info (url): page = requests.get(url) soup = BeautifulSoup(page.content,"html.parser") opCells = soup.find_all("div",class_="opCell") threads_ids = [] posts_ids = [] for opCell in opCells: threads_ids.append(opCell.get("id")) postCell = opCell.find_all("div",class_="postCell") try: posts_ids.append(postCell[-1].get("id")) except: posts_ids.append("none") array = [] array.append(threads_ids) array.append(posts_ids) return array def notification(): notification = Notify() notification.title = "¡Mensajes nuevos!" notification.message = "Hay mensajes nuevos en /ac/" notification.icon = "C:\\proyectos_python\\icon.ico" notification.audio = "C:\\proyectos_python\\ping.wav" notification.send() def check_equal (x,y): i = 0 logic = True while (i<=len(x)-1 and logic): if (x[i]==y[i]): i=i+1 else: logic = False return logic url = "https://8chan.moe/ac" board_info = get_info(url) while True: time.sleep(10) board_info_new = get_info(url) if (not(check_equal(board_info[0],board_info_new[0]))): notification() board_info = board_info_new else: if (not(check_equal(board_info[1],board_info_new[1]))): notification() board_info = board_info_new