Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Read URL Size

  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Read URL Size

    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
    Last edited by deathswan; 01-03-2004 at 01:49 AM.

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 (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.

    shmoove

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    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...
    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •