Varianta domestica, pentru cei care tin pc-ul in aprins 24/24. In loc sa trimita oferta prin email, o tipareste in fisierul "chilipiruri.txt" si beepaie #!/usr/bin/env python import urllib2 import random import re import time import winsound #panou de configurare chilipir = 25 # pretul(ron) sub care sunteti anuntat interval_timp_cautare = 600 # in secunde, default 10 min (600 s) beepuri = 5 # nr beepuri pauza_beep = 5 # pauza intre beepuri in secunde durata = 10 # durata beepului in secunde print r""" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#\ #.........RSTforums.com........#-\ #.............Usr6.............#--\/ #.Cautatoru de chilipiruri 1.1.#--/\ #..............................#-/ #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#/ """ def beeeep(TEXT): print TEXT with open("chilipiruri.txt", "a") as handle: handle.write("\n" *3 +str(time.strftime("%c")) +"\n" + TEXT) print "Verifica fisierul chilipiruri.txt" for i in range(beepuri): Freq = 2500 # Set Frequency To 2500 Hertz winsound.Beep(Freq,durata * 1000) time.sleep(pauza_beep ) return oferte = [] while True : oferta = "" random_nr = str(random.randint(10**16,99999999999999999)) ua = "Opera/%s.%s (Windows NT %s.%s) Presto/%s.%s.%s Version/%s.%s" \ %(random_nr[0], random_nr[1:3], random_nr[4], random_nr[5], random_nr[6], random_nr[7:9], random_nr[10:13], random_nr[13:15], random_nr[15:17]) try: site = "http://www.emag.ro/resigilate/sort-priceasc" req = urllib2.Request(site, None, {'User-Agent' : ua}) continut = urllib2.urlopen(req, timeout=30).read() match = re.findall('\"money-int\"\>(\d*)\<\/span\>\<sup class=\"money-decimal\"\>\d*.+\n.+\t+.+\n\t.+\n.+\n.+\<a href=\"(.+#resigilate)"',continut) for every in match: pret, link = every if int(pret) <= chilipir: link = "http://www.emag.ro" + link unic = str(pret) + link if unic not in oferte: oferta += str(pret) + "\t" + link +"\n" oferte.append(unic) except Exception as E: print "\n!!! EROARE !!!\n" beeeep(str(E)) if len(oferta) >= 1: beeeep(oferta) time.sleep(interval_timp_cautare) print time.strftime("%c"), "nimic nou" exit()