如何轮询简单网站的更新?
我有一位教授,他随机更新他的网站,其中包含明天到期的作业,并且似乎希望我们每小时检查一次。
这听起来像是一个程序的工作。
他的网站很简单,完全是 html,甚至没有任何 javascript。我如何以编程方式检测他的网站的任何更改/更新?
I have a professor who randomly updates his website with homework due tomorrow and seems to expect us to check it every hour.
This sounds like a job for a program.
His website is simple and entirely html, not even any javascript. How could I programatically detect any changes/updates to his website?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
检查
Last-Modified
响应标头。Check the
Last-Modified
Response header.获取并 md5 每个页面的内容。然后存储并与以前的值进行比较。请注意,这对于字符级别来说是敏感的。
或者,为
site:your-professors-website.com
设置 Google 快讯并将更新发送到您的电子邮件或通过 rss。Fetch and md5 the content of each page. Then store and compare with previous values. Note that this is sensitive down to the character level.
Alternativelly, setup a Google Alert for
site:your-professors-website.com
and have the updates delivered to your email or via rss.设置一个 cron 作业来定期 wget 或curl URL,然后 grep 查找相关文本,如果发现有趣的结果,则给自己发送一封电子邮件...
setup a cron job to periodically wget or curl the URL, then grep for relevant text, then send yourself an email if interesting results are found...