I'd like to detect when a website has changed, in particular when new products are announced on a site that doesn't change to often. Here's the code I wrote but I don't think it is perfect. Also the site might block me if I ping it too many times...
content = Hash@URLFetch["www.wolfram.com"];
$c = 0; Dynamic[$c]
RunScheduledTask[$c++;
If[content =!= Hash@URLFetch["www.wolfram.com"],
SendMail["To" -> "[email protected]",
"Subject" -> "The wolfram site has been updated!",
"Body" -> {"Check wolfram now"},
"From" -> "email", "Server" -> "smtp.gmail.com",
"UserName" -> "email", "Password" -> "pass",
"PortNumber" -> 587, "EncryptionProtocol" -> "StartTLS"];
content = Hash@URLFetch["www.wolfram.com"]], 100]
I'd also like to create a standalone executable for running this process in the background without mathematica being open.
Hash
instead of comparing the contents. $\endgroup$CloudDeploy
can help.. $\endgroup$