Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to get web creation date from webserver?

by pg (Canon)
on Aug 23, 2005 at 04:32 UTC ( [id://485817]=note: print w/replies, xml ) Need Help??


in reply to How to get web creation date from webserver?

use IO::Socket::INET; use strict; use warnings; my $connection = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "ja +gadish.blogspot.com", PeerPort =>80) || die "failed"; print $connection "HEAD http://jagadish.blogspot.com/index.html HTTP/1 +.1\r\nHost: jagadish.blogspot.com\r\n\r\n"; while (<$connection>) { ($_ eq "\r\n") ? last : print; }

Replies are listed 'Best First'.
Re^2: How to get web creation date from webserver?
by gube (Parson) on Aug 23, 2005 at 04:52 UTC

    Dear pg,

    I am getting this below output. In that date showing todays date. If i give any url i am getting today's date. But, the pages had been created long days ago. I want the creation date of the webpage in that server. Please help me any other possiblities

    here HTTP/1.1 200 OK Date: Tue, 23 Aug 2005 04:48:24 GMT Server: Apache Vary: Accept-Encoding test: %{HOSTNAME}e Last-Modified: Tue, 23 Aug 2005 04:36:44 GMT ETag: "84cadf-ada8-430aa7dc" Accept-Ranges: none Content-Length: 44456 Content-Type: text/html
      Could it be that these pages are dynamically generated and as such do not really exist on the file-system, other than in a virtual sense? That could explain you always see todays date: the files were freshly baked to your request.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      Last-Modified gives you the time when the content was BELIEVED to be last modified (or the time the current content is created). If you want the exact time when the original content (which is probably gone already) was first created, I don't believe HTTP specification provides that. However you have to re-think whether that time is meaningful.

      Well, if you actually have access to the server, that will be a different story, and you can just use whatever command the OS provides you to check, if the content is not created on fly.

Re: How to get web creation date from webserver?
by b10m (Vicar) on Aug 24, 2005 at 09:44 UTC

    TIMTOWTDI:

    use LWP::Simple; print @{[head('http://jagadish.blogspot.com/index.html')]}[2];
    --
    b10m

    All code is usually tested, but rarely trusted.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://485817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found