"Chidambaram" <[EMAIL PROTECTED]> wrote in message
> Hi
> i have to calculate the size of a remote url
> ex:http://www.ee.iitm.ernet.in/index.html
> i have written a php script but it returns only
> the size of html page it doesnot include the images
> size in that file could anyone help me in this regard

Is this for interest, for once-in-a-while data collection,
or for run-on-every-request production code?

You would have to parse the HTML file,
extract the names of all the images (and CSS files,
applets/ActiveX components, and javascript/vbscript
inclusions) called, fully qualify the names, remove
duplications (which would be served from the client's
cache), request the files and check their sizes, then
add it all up with some additional time for each request.

Alternatively, you could wave your hands and come
up with some sort of fudge factor; if you want to
be a bit more accurate, set your super-complete-script
to try a couple thousand random URLS and scatter-plot
the results, HTML-only page size vs. total page size -
less reliable but far simpler and faster.  If the result is
within 20% for 80% of the time, I would be happy.

Note that any kind of generated or active page may
vary wildly in size anyway - your approach would
only work on totally static pages.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to