View Full Version : Read URL Size
01-03-2004, 12:58 AM
I am a total newb so please dont leave anything out if you can help me. Heres the deal: at www.gameranger.com/indicator.cgi?account#here the size of the webpage (in BYTES) will tell whether or not the user is online or offline. I am building a webpage which will tell if members in my "clan" are online or offline on the Gameranger service. I need to embed an ASP script into my html that will compare the size of the above url with the known online/offline sizes and then depending on which one it matches, I need to display the word "online" or "offline" next to that person's name on my webpage. Please help me, and leave your AIM screenname if you can so I can communicate that way. Thanks!
Also, please tell me exactly how, where, etc. to embed it in the html
01-03-2004, 08:58 AM
ASP can't just go out and read pages at will by itself. You need an "HTTP getter"-type component that can do that. Something like ASPTear (http://www.alphasierrapapa.com/IisDev/Components/AspTear/) (there are others, too, so feel free to scout the web for anything better).
Then you have to install that dll on your server, register it, and then you can use CreateObject to make one of those and get that page. I'm not sure if ASPTear supports this (it's been a while since I played around with it), but getting a request of type HEAD is enough since you can get the size of the page from the content-length header.
There are instructions on how to use the component on the webpage.
01-05-2004, 01:06 AM
Microsoft's own MSXML.ServerXMLHTTP component is installed on most IIS servers nowadays, and is very powerful when used properly, so I suggest that you use that in preference to ASPTear.
Using the HEAD HTTP request is pretty efficient (compared to retrieving the whole page), but I don't think that comparing page HTML sizes is a very futureproof approach - it would only take a change to the site layout, or even a minor change to the actual data displayed on the page to throw your system out. Instead you should isolate what changes between the two pages and search the retrieved HTML source for an appropriate string in order to derive the online/offline status.
However, if the URL (when supplied with an appropriate account number as part of the querystring) actually returns image data instead (i.e. an online or offline image as appropriate), then it's all cool! It's impossible to tell with the URL you quoted above... :)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.