[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] HTTP Last-Modified
From: |
Paulo Roberto Bagatini |
Subject: |
Re: [shell-script] HTTP Last-Modified |
Date: |
Sun, 25 May 2008 17:28:16 -0300 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080421) |
Tiago Barcellos Peczenyj escreveu em 25-05-2008 16:25:
Ola.
Para ver os headers de uma requisição http vc pode usar o curl -v
(verbose) ou fazer uso do comando HEAD (com o comando -I)
Ex:
URL=http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/0.8/linux-i686/pt-BR/sunbird-0.8.pt-BR.linux-i686.tar.gz
Sim. Como eu disse, achar o timestamp do ARQUIVO eh facil. O problema eh
o timestamp do DIRETORIO. Observem o que o script abaixo retorna:
path="http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases"
mask="[[:alnum:].]+"
lynx -dump -listonly $path | tr -d \ | cut -d. -f2- | grep -E
$path/$mask/ | while read j
do
echo $j
lynx -dump -head $j
done
>http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/0.5/
>HTTP/1.0 200 OK
>Connection: close
>Content-Type: text/html
>Content-Length: 2521
>Date: Sun, 25 May 2008 20:21:33 GMT
>Server: lighttpd/1.4.19
>
>http://releases.mozilla.org/pub/mozilla.org/calendar/sunbird/releases/0.7/
>HTTP/1.1 200 OK
>Date: Sun, 25 May 2008 20:21:34 GMT
>Server: Apache
>Connection: close
>Content-Type: text/html;charset=ISO-8859-1
>
>...
Em momento algum, ou com raras exceções, o campo Last-Modified, cujo
valor eh parcialmente visivel na listagem bruta do diretorio pai:
lynx -dump --nolist $path
> Index of /pub/mozilla.org/calendar/sunbird/releases
>
> [ICO] Name Last modified Size Description
> __________________________________________________________________
>
> [DIR] Parent Directory -
> [DIR] 0.5/ 15-Oct-2007 04:12 -
> [DIR] 0.7/ 29-Oct-2007 15:25 -
> [DIR] 0.8/ 12-Apr-2008 03:00 -
> [DIR] 0.8rc1/ 07-Mar-2008 03:10 -
> [DIR] 0.8rc2/ 02-Apr-2008 01:24 -
> __________________________________________________________________
>
>
> Apache/2.2.3 (Red Hat) Server at releases.mozilla.org Port 80
E eu PRECISO saber o TS desses diretorios de nivel acima, para saber em
qual deles entrar, e entao sim, vasculha-lo em busca do arquivo mais novo.
Repito: o problema eh o timestamp do DIRETORIO.
Alguma sugestao?
[]'s
--
------------------------ __o address@hidden ----.-----------
P@ulo Roberto Bagatini _`\<, www.ceat.net/~arkanon \
-=---=---==---=---=- (_)/(_) Phone +55 51 3748 7000 `--------
Lajeado - RS - Brasil --------- ICQ 34 789 30 - LinuxUser 102.514
---------------------------------------------------------------------