Re: php->html "rendering"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 12 June 2006 17:08, Ryan A wrote:

> > that said it could take a week to figure out all the
> > parameters. ;-)
>
> Heck yeah... just been reading up on it... lots of
> stuff, who would think one little four letter word
> could do so much.....oops, now thinking of another
> four letter word without which....none of us would be
> here

That's why I included the switches I did. :-)  I had to do something very 
similar just last week.  I needed to make a static snapshot of a site we 
built for a client using a CMS, so everything was dynamic.  They needed a 
static snapshot to put on a laptop to take to a tradeshow.  wget, with a wee 
bit of sed massaging, did the trick quite well.

-m means "mirror".  That is, recurse to all links that don't leave the domain.  
It's for exactly this sort of task.

-k tells it to convert links.  That way if you have all absolute links in your 
HTML output, it will mutate them for you to stay within the local mirror 
you're creating.

If you have GET queries in your pages (we did), then I recommend also using:

--restrict-file-names=windows

That will tell it to convert any blah?foo=bar links into blah@foo=bar, since 
the first is not a valid filename in Windows.  I find that even on a Linux 
box, the latter works better.

So your full command would be

wget -m -k --restrict-file-names=windows http://www.example.com/

Start with that and see what you get, then refine as needed.  If it's a big 
site, you may also want to use the --wait and --random-wait switches to avoid 
causing the web server to flip out.

wget is one of those *nix command line utilities that's been around forever, 
does exactly one thing, but does it so amazingly well (once you realize how) 
that it renders about 50 commercial applications completely pointless. :-)

-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux