[clue-tech] Fun perl script
Mike Staver
staver at fimble.com
Tue Aug 1 12:02:45 MDT 2006
marcus hall wrote:
> It looks like this script is reading the file name, not the contents
> of the file itself.
>
> It looks like it is passed URLs as input, and if it is a .jpg or
> a .gif file, it retrieves the file with wget and saves the file in
> /space/WebPages/images/XXXX-YYY.jpg (or .gif), then outputs a
> new URL to reference the file from 10.0.0.16 (presumably that server's
> IP address). If the URL isn't a .jpg or .gif, it just passes the URL
> to the output. Some other program actaully uses the URL later on.
>
> It would be possible, perhaps, to put in a similar line for .html (or
> other URL suffixes) that performs a similar wget, but pipes the
> result through sed to perform the manipulations and saves the file,
> then generate a new URL for the modified file and print that.
>
> I believe that what the above change will accomplish is to replace URLs
> that contain "Clinton|Bush|..." with the probably non-functional URL "Staver",
> and "Windows|Microsoft" with "Linux". Note that it is not replacing the
> target word, but the entire URL, so if somebody requests the URL
> "http://SecretsOfWindows.html", this script would return "Linux", which
> probably would not work in whatever context a URL is wanted.
Yeah, that definitely makes more sense. I have this script referenced
in squid just like the guy did in that article. I'll take a crack at
doing a search for .html, .htm, .asp, .php, or .cfm and see what I can
do. Thanks for the info.
--
-Mike Staver
staver at fimble.com
mstaver at globaltaxnetwork.com
More information about the clue-tech
mailing list