Re: CGI question
by "Harold A. Driscoll" <harold(at)driscoll.chi.il.us>
|
| Date: |
Mon, 03 Apr 2000 12:48:22 -0500 |
| To: |
"Jason N. Price" <jprice(at)visi.com> |
| Cc: |
hwg-techniques(at)hwg.org |
| In-Reply-To: |
hwg |
| |
todo: View
Thread,
Original
|
|
At 16:35 02-04-00 , Jason N. Price wrote:
>Is it possible for a CGI script to check for the number of
>occurrences of a certain graphic on a site?
On its own site, it can look at whatever part of the filesystem for which
it has access and knowledge.
>For example, if a page had a list of game servers, and it used
>up.jpg and down.jpg to signify whether the server is
>up or down, would it be possible for a CGI script to count
>the number of "up.jpg" occurrences?
Sounds like what you want to do is get a page, and count the number of
_references_ to those graphics.
To get a page is easy, just use the HTTP modules. Realize that the response
latency will be added to the latency of your script. To count the number of
occurrences, you can just do pattern matching on the page contents, or you
can use the HTML modules to do the parsing. Both will work, and are fairly
straightforward.
If you doing this with any frequency, I'd consider running a process that
periodically checks the status and updates a page, sleeping for an interval
(seconds to hours, as appropriate, and then repeats) and the have users
check that page... remember to have an expires corresponding with the
update interval.
Safe computing, /Harold
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Harold A. Driscoll mailto:Harold(at)Driscoll.Chi.IL.US
#include <std/disclaimer> http://Driscoll.Chi.IL.US
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.