I would like to be able to get the date modified for a url, e.g.:
v2-changes
https://autohotkey.com/v2/v2-changes.htm
The InternetFileGetTime function returns:
Sun, 20 Sep 2015 22:21:47 GMT (20150920222147)
however, the content has definitely been modified this year, clear from some of the newer material.
InternetFileGetTime() - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=1252
NirSoft IECacheView gives the date:
16/06/2017 09:54:15
which is plausible.
Compare with:
AutoHotkey v2 alpha (UPDATES) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 55#p159655
Any ideas would be welcome. Thanks for reading.
urls: get date modified Topic is solved
urls: get date modified
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: urls: get date modified Topic is solved
In InternetFileGetTime(), if you change try WebRequest.Open( "HEAD", URL ) to try WebRequest.Open( "GET", URL ) it will do what you want. Sadly, I think the page gets downloaded now in its entirety, but I don't know anything about the Internet to be able to give you a better solution.jeeswg wrote:The InternetFileGetTime function returns:
Sun, 20 Sep 2015 22:21:47 GMT (20150920222147)
however, the content has definitely been modified this year, clear from some of the newer material.
InternetFileGetTime() - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=1252
Re: urls: get date modified
Cheers, that's amazing, I hardly ever want to do this, so it doesn't really matter if I have to download the whole webpage. Interesting that all it took was to change HEAD to GET, I wonder how you figured that out.
Btw based on here:
download urls to vars, partially/fully, via WinHttpRequest - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 09#p168409
This appeared to work, to avoid unnecessarily downloading data:
I made your change, and added the Range line, and I did retrieve the correct date. It also appeared to prevent the downloading of data, confirmed by adding this line:
Hmm, why the difference in dates, what does it signify? Created/modified? Something else?
I'll mark this as solved, although any other ideas would be most welcome.
Btw based on here:
download urls to vars, partially/fully, via WinHttpRequest - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 09#p168409
This appeared to work, to avoid unnecessarily downloading data:
Code: Select all
WebRequest.SetRequestHeader("Range", "bytes=0-0")
Code: Select all
MsgBox, % WebRequest.ResponseBody.MaxIndex()
I'll mark this as solved, although any other ideas would be most welcome.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: urls: get date modified
Luck I had a snippet involving the WebRequest object from somewhere else and I noticed that was giving me a more recent date.jeeswg wrote:Interesting that all it took was to change HEAD to GET, I wonder how you figured that out.
That's a nice solution. I guess for servers that support it (which, thankfully, in 2017 is most of them) that makes using GET not so bad.This appeared to work, to avoid unnecessarily downloading data:I made your change, and added the Range line, and I did retrieve the correct date. It also appeared to prevent the downloading of data, confirmed by adding this line:Code: Select all
WebRequest.SetRequestHeader("Range", "bytes=0-0")
Code: Select all
MsgBox, % WebRequest.ResponseBody.MaxIndex()
It could be a Cloudflare thing, maybe?Hmm, why the difference in dates, what does it signify? Created/modified? Something else?