I have a python application that relies on a file that is downloaded by a client from a website.
The website is not under my control and has no API to check for a ‘latest version’ of the file.
Is there a simple way to access the file (in python) via a URL and check it’s date (or size) without having to download it to the clients machine each time?
update: Thanks to those who mentioned the’last-modified’ date. This is the correct parameter to look at.
I guess I didn’t state the question well enough. How do I do this from a python script? I want to application to check the file and then download it if (last-modified date < current file date).
Check the Last-Modified header.
EDIT: Try urllib2.
EDIT 2: This short tutorial should give you a pretty good feel for accomplishing your goal.