简体   繁体   English

如何获取在线文件的最后修改日期?

[英]How to get online file's last modified date?

I am writting an app for my college and it should alert user when some changes have occured on college's websites. 我正在为我的大学写一个应用程序,它会在大学网站上发生一些变化时提醒用户。 The problem is that I can't change these websites, only read them; 问题是我无法改变这些网站,只能阅读它们; yet they don't have "last-modified" in html header. 但他们没有在html标题中“最后修改”。

For now I compare them by downloading the whole html code, then making MD5 checksum out of it, thus seeing if something has changed. 现在我通过下载整个html代码,然后从中调出MD5校验和来比较它们,从而看看是否有变化。 But there should be some better(faster) way, or not? 但应该有一些更好(更快)的方式,或不是?

You can check md5 on server every 5 seconds and then just answer for little file with true/false result)). 您可以每隔5秒检查服务器上的md5,然后只回答带有true / false结果的小文件))。
Also you can connect to servers with ftp and check files status if you have access to it. 如果您有权访问它,也可以使用ftp连接到服务器并检查文件状态。
I also find this guys - they sends notifications when choosed site has changed. 我也找到了这些 - 他们在选择的网站发生变化时发送通知。

But i think your variant is much easer). 但我认为你的变体更容易)。
What is wrong with it? 这有什么问题? To much time spent for the check? 花了很多时间检查?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM