Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Image Crawler to remove unused images in a website


Jonesy - 9:30 pm on Mar 11, 2012 (gmt 0)


linux:
I generally use the web site layout ala:
...../documents/
...../documents/images/

On my workstation (using the command line) I enter the .../images/ sub-directory
and:

...../images$ for IMG in * ; do echo $IMG ; grep -l $IMG ../* ; done

(That's a lower-case "ell" for the grep switch.)
Any image listed without any following lines of files noted by grep is a file not to be found in any document: html, php, css, etc., usw.

If you wish, you could get more elaborate with the -r|-R (recursive) switch for grep.

Of course it works only for static web pages....

HTH,
Jonesy


Thread source:: http://www.webmasterworld.com/php/4425029.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com