This repository has been archived on 2020-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
2017-03-11 12:28:03 +01:00
|
|
|
#!/usr/bin/env python3
|
2017-03-11 13:15:06 +01:00
|
|
|
# get user email -> get url -> get price
|
|
|
|
#download website -> search for price -> compare price
|
|
|
|
#if price = website.price -> send mail(user.mail, url)
|
2017-03-11 12:28:03 +01:00
|
|
|
|
2017-03-11 13:15:06 +01:00
|
|
|
from lxml import html
|
|
|
|
import requests
|
2017-03-11 12:28:03 +01:00
|
|
|
|
2017-03-11 14:00:39 +01:00
|
|
|
class User(object):
|
|
|
|
|
|
|
|
def __init__ (self):
|
|
|
|
self.email = ""
|
|
|
|
|
|
|
|
def prompt_for_email(self):
|
|
|
|
self.email = input("Please enter your email address:")
|
2017-03-11 12:28:03 +01:00
|
|
|
|
2017-03-11 13:15:06 +01:00
|
|
|
class Website(object):
|
2017-03-11 14:00:39 +01:00
|
|
|
|
|
|
|
def __init__ (self):
|
|
|
|
self.url = ""
|
|
|
|
|
|
|
|
def prompt_for_url(self):
|
|
|
|
url = input("Please enter the url you want to monitor:")
|
|
|
|
|
|
|
|
def get_page(self, url):
|
|
|
|
page = requests.get(url)
|
|
|
|
tree = html.fromstring(page.content)
|
|
|
|
return self.tree
|
2017-03-11 13:15:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Price(object):
|
2017-03-11 14:00:39 +01:00
|
|
|
|
|
|
|
def __init__ (self):
|
|
|
|
self.desired_price = ""
|
|
|
|
|
|
|
|
def prompt_for_price(self):
|
|
|
|
desired_price = input("Please enter the price
|
|
|
|
you're looking for:")
|