Have you ever wanted to know when the WL or the Wolfram Cloud updates? Here is one way to do it...
Have you ever wanted to know when the WL or the Wolfram Cloud updates? Here is one way to do it...
While working with Wolfram Cloud, I wanted to know when it would get a new version of the Wolfram Language. I could check $VersionNumber every day, but better would be an automated notification email. Here is one way to do it, using ScheduledTask[]:
(*SavingourcurrentWLversioninavariable*)currentWLVersion=CloudPut[$VersionNumber,"current-wl-version-number"]
checkForCloudWLUpdate[] := If[CloudGet["current-wl-version-number"] =!= $VersionNumber, (* The cloud WL version has changed so send a notification *) SendMail[<| "To" -> $CloudUserID, "Subject" -> "Cloud is now running Wolfram Language " <> ToString[$VersionNumber], "Body"->"The Wolfram Cloud has updated to Wolfram Language version " <>ToString[$VersionNumber] |>]; CloudPut[$VersionNumber, currentWLVersion]]
(*CreatinganotificationthatcheckseverydayiftheWLversionhaschanged*)CloudDeploy[ScheduledTask[checkForCloudWLUpdate[],"Daily"],"CloudUpdateNotification"]
This will then run every day, and let you know when it has been upgraded. What if you also wanted to know when the Wolfram Cloud itself was upgraded? This can happen without upgrading the Wolfram Language version, and may bring with it new features and bug fixes, so it’s good to know. We can extend this code to handle this by adding a second function, and calling it from the same ScheduledTask[] I created:
(*SavingourcurrentWolframCloudversioninavariable*)currentCloudVersion=CloudPut[$CloudVersion,"current-cloud-version"]checkForCloudVersionUpdate[] := If[CloudGet["current-cloud-version"] =!= $CloudVersion, SendMail[<| "To"->$CloudUserID, "Subject"->"Wolfram Cloud is now running " <> $CloudVersion, "Body"->"The Wolfram Cloud has updated to version " <> $CloudVersion|>]; CloudPut[$CloudVersion, currentCloudVersion]]
(*CreatinganotificationthatcheckseverydayiftheWLandWolframCloudversionhavechanged*)CloudDeploy[ScheduledTask[checkForCloudWLUpdate[];checkForCloudVersionUpdate[],"Daily"],"CloudUpdateNotification"]
Then that’s it! CloudUpdateNotification task checks daily if the Wolfram Language and the Wolfram Cloud have changed using the same ScheduledTask[] function, easy.