Hash the downloaded file and compare it to the previous oneĪdditionally, there’s technically a fourth aspect which is the scheduler (i.e.There are roughly three main aspects to this program which detects and notifies when a file has changed: Rather than manually checking the PDF every day or every week for changes, I decided to write a Python program to automatically check for changes to the file every day and send me a notification if it found updates.Ĭall me lazy or a nerd, but I like to automate certain things to make my life easier. ![]() And at least once I saw no update for the entire month. Sometimes it’s in the beginning of the month. The problem is that I don’t know when the PDF receives its updates. Its performance is updated approximately every month. Let me set the stage for you: I’m invested in this fund at Charles Schwab. Note: Feel free to skip this section if you just want the meat of the tutorial. I didn’t want to mess around with setting up an email server believe me, it’s a pain in the ass (spam filters nowadays are tough).Īnyway, follow along and maybe you’ll learn a thing or two about how you could possibly write a similar Python program to automate some aspect of your life. There is also a notification aspect of the Python program which notifies my phone via a push notification. ![]() Although this set of instructions specifically shows you how to watch PDFs for changes, the concept of comparing file hashes (specifically a SHA1 hash function) holds true for most other files, both local and at a remote URL. In this tutorial, you’ll learn how to detect when a file has changed with a Python program that automatically executes on an interval via a cronjob.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |