Update
OK, I made some updates per suggestions. Internal documentation is now more specific. I should note you can probably use non-gmail sendmail servers, but I didn't feel like fiddling with that part too much. Also, I wrapped the tracking routine with exception handling to deal with cases when the server doesn't respond. When you start tracking you will get an initial email so you can make sure it is working.
The major change is that the program now accepts command line arguments. Now, if you type "python TrackIpadStock.py" you will get an immediate printout of availability. If you type "python TrackIpadStock.py -t" you start the tracking routine. You can add "-c" to always send the mail if currently available. Add "-i30" to set the wait interval for 30 minutes. Add "-a somebody@somewhere.com" to change who the email is sent to.
So to recap:
Print: python TrackIpadStock.py
MailTracking: python TrackIpadStock.py -t
FullOptions: python TrackIpadStock.py -t -i30 -c -a somebody@somewhere.com
Please use common sense. There is no need to set the interval to every minute.
Edit: Fixed an issue that reported old results if you changed the model list
Edit: This script will not work with Python 3
Edit: Fixed a bug with the history as of u4
Edit: Tweaked for better error handling in u5, and made the email html. Now if you click on the availability it takes you to the website for that store and model.
Edit: Fixed a bug with the history as of u6
Edit: Fixed a bug with error reporting as of u7
Edit: Fixed a bug with error reporting as of u8
Edit: Added overall error handling as of u9
I liked that script so much I enhanced it. This version allows you to check multiple models and zipcodes, and is set up to check periodically and email you with any changes. Instructions are in the file. Cheers! Here's hoping I can snag one before the scalpers.
OK, I made some updates per suggestions. Internal documentation is now more specific. I should note you can probably use non-gmail sendmail servers, but I didn't feel like fiddling with that part too much. Also, I wrapped the tracking routine with exception handling to deal with cases when the server doesn't respond. When you start tracking you will get an initial email so you can make sure it is working.
The major change is that the program now accepts command line arguments. Now, if you type "python TrackIpadStock.py" you will get an immediate printout of availability. If you type "python TrackIpadStock.py -t" you start the tracking routine. You can add "-c" to always send the mail if currently available. Add "-i30" to set the wait interval for 30 minutes. Add "-a somebody@somewhere.com" to change who the email is sent to.
So to recap:
Print: python TrackIpadStock.py
MailTracking: python TrackIpadStock.py -t
FullOptions: python TrackIpadStock.py -t -i30 -c -a somebody@somewhere.com
Please use common sense. There is no need to set the interval to every minute.
Edit: Fixed an issue that reported old results if you changed the model list
Edit: This script will not work with Python 3
Edit: Fixed a bug with the history as of u4
Edit: Tweaked for better error handling in u5, and made the email html. Now if you click on the availability it takes you to the website for that store and model.
Edit: Fixed a bug with the history as of u6
Edit: Fixed a bug with error reporting as of u7
Edit: Fixed a bug with error reporting as of u8
Edit: Added overall error handling as of u9
Attachments
Last edited: