change script to a single run
This commit is contained in:
parent
22b9f7bcba
commit
147f1b599d
|
@ -104,17 +104,16 @@ class Configuration():
|
|||
self.recipient_address = self.config['DEFAULT']['recipient_address']
|
||||
|
||||
|
||||
dryscrape.start_xvfb()
|
||||
settings = Configuration()
|
||||
email = Email(settings.recipient_address)
|
||||
website = Website(settings.url)
|
||||
|
||||
while True:
|
||||
website.get_page()
|
||||
if website.extract_price() < settings.price:
|
||||
website.get_page()
|
||||
if website.extract_price() < settings.price:
|
||||
email.connecting(settings.smtp_server, settings.smtp_port)
|
||||
email.login(settings.sender_address, settings.password)
|
||||
email.sending(settings.sender_address, settings.url)
|
||||
sys.exit(0)
|
||||
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
|
||||
print("No Match yet")
|
||||
time.sleep(10)
|
||||
else:
|
||||
sys.exit(0)
|
||||
|
|
|
@ -1,4 +1,13 @@
|
|||
#!/bin/bash
|
||||
source bin/activate
|
||||
./price_checker.py
|
||||
# Get the current working directory
|
||||
SCRIPTPATH=$(dirname -- "$(readlink -e -- "$BASH_SOURCE")")
|
||||
|
||||
# add the bin directory to the path
|
||||
PATH=$PATH:$SCRIPTPATH/bin/
|
||||
|
||||
# activate the virtual environment
|
||||
source $SCRIPTPATH/bin/activate
|
||||
|
||||
# execute the main script
|
||||
python3 $SCRIPTPATH/price_checker.py
|
||||
exit 0
|
||||
|
|
Reference in New Issue