I am on Mac OS X, and I have only rudimentary programming experience (well, I am fairly proficient with Matlab, but that’s definitely not the right language for this job.) I am aware of the following: the ‘wget’ command is not available in OS X, but ‘curl’ is. A program can be made to launch when the machine starts up, by putting it in the LoginItems folder or the StartupItems folder. I do not know how to do a bit-wise check for differences between files, nor do I know how to use md5 hashes.
The following can be hard-coded:
URL to check (in this case it is http://api.usno.navy.mil/imagery/moon.png, which is the image used on this page showing What the Moon looks like now)
Directory in which to save files (perhaps ‘../Archive/’)
Time interval between checking the URL (5 minutes)
Then it just has an endless loop until the program is terminated:
If time interval has elapsed since last check (or if there was no previous check) then
Fetch the file from the URL
Compare to previous versions, probably with md5 hashes
If the file changed, save a copy of it with the current time in its filename, and save its md5 hash
I have a tiny bit of experience with Objective-C, and I have Xcode installed and know the basics of how to use it, so that is one option for the language. I don’t have much experience with scripting languages, though I know Mac OS X supports several.
So I’m asking for help. What is a good language to use for this task, keeping in mind the person doing it does not yet know that language? What are the relevant commands in that language for doing the various parts of this program, and vitally, what is the exact syntax for using those commands the “right way”?
This is not in any way homework. It is something I want to do for myself, and if it serves as a stepping stone toward learning some programming or scripting language, so much the better.
This may be compared to the C++ and Java classes I took in college, where there was a lot of conceptual stuff and it got to the point where I was thinking, “Yes, I understand the principle behind a doubly-linked list, and the tradeoffs between time and storage space in various algorithms, but that doesn’t tell me when I need a colon or a semicolon or parentheses or curly braces or what the built-in command is for parsing a string into an int. I can read C/C++/Java code all right, I just don’t know how to actually write useful things with them.