Today I needed to get Drupal's ImageCache module to regenerate a bunch of resized images. ImageCache doesn't create the images until a browser requests them and at that point the new image is saved to the disk for future use.
One way to generate the images would have been to just click my way through every page on the site but I'm way to lazy for that. So I used wget:
wget -r -nd --delete-after http://example.comBy using the recursive (-r) and --delete-after switches I was able to have it crawl the site and get all the images generated. Bonus points for running in on the server so that the transfers were via the loopback interface so the transfer didn't count against the monthly bandwidth limit.
I needed such thing
I needed such thing yesterday. But I had no shell access to the server. So I just put such code to my template php right in beginning of imagecache's thememing function:
function phptemplate_imagecache($namespace, $path, $alt = '', $title = '', $attributes = NULL) {if (!file_exists(imagecache_create_path($namespace, $path))) {
file_get_contents(file_create_url(imagecache_create_path($namespace, $path)));
}
// Everyting else - as usual
if ($image = image_get_info(imagecache_create_path($namespace, $path))) {
....
Now user gets a final images without need to refresh a page.
stupid wget tricks
That is a neat idea. I just wanted to mention that you could also save the output from wget to /dev/null (-o or -O option, I always confuse curl and wget flags). Peace :)
They should have taken
They should have taken backup from a third party service , not to loose the market. örgü modelleri